Skip to content

Two new articles for the Arduino AI Assistant #489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: "About the Arduino AI Assistant"
id: 19958917855132
---

The Arduino AI Assistant is an experimental feature in the Arduino Cloud Editor, that uses Generative AI to help write code for your sketch.

In this article:

<!-- TOC -->

- [Requirements](#requirements)
- [Getting started with the Arduino assistant](#getting-started-with-the-arduino-assistant)
- [Undo an applied suggestion](#undo-an-applied-suggestion)
- [Further reading](#further-reading)

<!-- /TOC -->

## Requirements

The Arduino AI Assistant is available on all Cloud plans.

The maximum number of requests that can be sent each month depends on the Cloud plan:

| Plan | Interactions |
|--------------------|--------------|
| Free | 30 / month |
| Maker | 1500 / month |
| School | 1500 / month |
| Team or Enterprise | Unlimited |

To see all the options, check out cloud.arduino.cc/plans.

## Getting started with the Arduino assistant

Follow these steps:

1. Go to [app.arduino.cc/sketches](https://app.arduino.cc/sketches).

1. Choose a sketch to open in the Cloud Editor:

- **Create a new sketch:** Click on the Create button in the top-right corner and choose New Sketch.
- **Open a saved sketch:** Click on a sketch you want to open.

1. Select the AI assistant tab in the sidebar:

![The Arduino AI Assistant button, in the sidebar of the Arduino Cloud Editor.](img/select-ai-assistant.png)

1. Do one of the following to start a conversation:

- Select a hint to send the suggested message (available when the chat history is empty).
- Type a message into the text field and press Enter to send.

1. Arduino AI Assistant will write a response.

1. Refine or continue:

- If the response isn’t quite right, try:

- Rephrasing your question

- Asking for more detail or examples

- Saying “Try again” or “Make it shorter/longer/more casual”

- If the response include a **code suggestion**, these actions will be available:

- _Copy:_ Copy the suggestion to your clipboard.

- _Apply:_ Apply the suggestion to the main sketch file.

**Prompt examples:**

- _Code generation:_ "I want to draw on the LED matrix a column of 4 LEDs that is moving from left to right over time."
- _Explanatory:_ "How does the sketch loop work in this sketch?"

## Undo an applied suggestion

To undo an applied suggestion Press <kbd>Ctrl</kbd> + <kbd>Z</kbd> (Windows/Linux) / <kbd>⌘</kbd> + <kbd>Z</kbd> (macOS) or select Edit > Undo in top menu bar.

If the Cloud Editor is closed or refreshed, previously applied suggestion cannot be undone. Please back up important sketches before applying suggestions.

## Further reading

- [Understand how the Arduino AI Assistant works and how it uses your data](https://support.arduino.cc/hc/en-us/articles/19958862731804)
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "Understand how the Arduino AI Assistant works and how it uses your data"
id: 19958862731804
---

Learn about the underlying AI models and services used by the Arduino AI Assistant and how your data is processed.

To learn how to use the Arduino AI Assistant, see [About the Arduino AI Assistant](https://support.arduino.cc/hc/en-us/articles/19958917855132).

In this article:

<!-- TOC -->

- [How answers are generated](#how-answers-are-generated)
- [Is my code or personal information used to train the Assistant?](#is-my-code-or-personal-information-used-to-train-the-assistant)
- [Terms of use](#terms-of-use)

<!-- /TOC -->

## How answers are generated

The Arduino AI Assistant uses AWS services and AI models to generate code based on user prompts.

Here's a short summary of the process:

- When a user asks a question, this prompt, along with the user's current Arduino sketch code, is sent to the backend AI models.
- The backend utilizes AWS Bedrock, which is a framework for Generative AI.
- Within Bedrock, the specific AI model used is Claude Sonnet from Anthropic. See more information and the model card of this AI model here: [https://www.anthropic.com/news/claude-3-7-sonnet](https://www.anthropic.com/news/claude-3-7-sonnet)
- To enhance the relevance of the AI's responses, the Arduino AI Assistant employs Retrieval Augmented Generation (RAG) using the Knowledge Bases feature of AWS Bedrock.
- Arduino maintains a knowledge base of relevant articles, tutorials, and code examples extracted from our documentation platform (`docs.arduino.cc)` and library examples related to libraries developed by Arduino. User sketch code is not included in this knowledge base.
- When a user asks a question, the system matches the question with relevant documents in the knowledge base.
- If a match is found, the relevant document(s) are added to the prompt sent to the AI model as additional context.

The AI model (Claude Sonnet 3-7) was pre-trained by Anthropic, and Arduino is not performing model training or fine-tuning. Arduino reviewed the capabilities of Claude 3.7 Sonnet, finding it was already very good at generating code for Arduino sketches. For information about how the AI model was trained, please refer to the model card from Anthropic.

The primary way Arduino improves the model output is through prompt engineering and the use of RAG. Note that the RAG process is not a form of model training.

Arduino also uses a system prompt to instruct the AI model on how to handle requests, stay relevant, and avoid certain topics. Guardrails provided by AWS Bedrock are in place to avoid the generation of dangerous content.

## Is my code or personal information used to train the Assistant?

No, your sketch and your interactions with the assistant prompt are not used for further training of the backend GenAI model.

No personal information is shared with the backend GenAI model. The sketch code and your prompt are shared with the backend GenAI model, hence we recommend that you don’t put any personal details in there. Please review the Terms of use for further details.

## Terms of use

In order to use the Arduino AI Assistant, the user must accept a specific set of terms of use, which also clarify the user responsibilities. You can review the Terms of Conditions when using the Arduino AI Assistant for the first time.

<!-- markdownlint-disable-file HC001 -->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.