# The AI assistant: proposals you accept or reject

The assistant lives in the chat on the right of the schematic. It reads your circuit, runs simulations and proposes changes, and nothing changes until you accept. You meet the chat, let it tune a part to a target and accept the proposal, then talk to the same assistant from a terminal. About 15 minutes.

**About the pictures.** They are taken offscreen, where no model is connected, so the chat says "The agent needs the desktop app". On your desktop with no API key it says "Add your API key in Preferences › Assistant" instead. Steps 2 to 4 need no key at all: Tune runs inside Voltecx and comes back as the same kind of proposal card the assistant makes.

Pictures: a numbered red box is what you click or read, `[Send]` is a button, `Edit › Preferences` a menu path.

## 1. Find the chat

Open `File › Open Example › DC-DC › Buck converter with thermal model` (the circuit of [tutorial 8](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/08-thermal-losses/)). The chat is the second tab of the right side bar, next to `PROPERTIES`.

![The chat: the hint, the model picker and Tune, marked 1 to 4](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/assistant-mcp/01-panel.png)

1. The `ASSISTANT` tab. Each circuit keeps its own chat; `+` at the right starts a new one, and `⌘L` opens the tab with the keyboard in the input.
2. The status line. With a key it shows suggestions such as "Design a 48 V to 12 V, 10 A buck".
3. The model picker (Claude Opus 5.5, `claude-opus-5-5`, by default) and the effort picker (Auto effort).
4. `Tune`, which needs no key.

To use the assistant itself, open `Edit › Preferences › Assistant`, paste an Anthropic API key and press `Save`. The key goes to your system's credential store, never into a file. Your messages and the circuit data the assistant asks for go to Anthropic's API, and only when you press `Send`.

## 2. Ask for a target

Click `Tune` and fill in the form: make the mean of `v(out)` equal 10 V by changing the duty cycle.

![The Tune to spec form filled in, marked 1 to 6](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/assistant-mcp/02-tune.png)

1. Target signal: `v(out)`, statistic `mean`.
2. Comparison: `=`.
3. Value: `10`.
4. Vary: part `Duty`, parameter `value`,
5. between `0.1` and `0.5`.
6. `[Run]`.

## 3. Read the proposal

![The proposal card: met in 9 iterations, Duty 0.26 → 0.2175, and the ghost on the schematic, marked 1 to 4](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/assistant-mcp/03-card.png)

1. `Tune to spec` (badge MET): after 9 iterations the card names each target with its signal, statistic and unit: `v(out) mean: 12.06 V → 10.02 V (= 10 V)`, with `Duty.value` from 0.26 to 0.2175.
2. The ghost: `Duty` gets an outline and a note on a plate, `Duty.value: 0.26 → 0.2175`, placed clear of the part names. A part the proposal would add is drawn at 40 % opacity where it would go.
3. `[Accept]` applies the whole proposal as one undo step.
4. `[Reject]` throws it away.

The circuit has not changed yet. A message to the assistant ("make the output 10 V") ends the same way: tool rows for what it ran, then a card like this one.

## 4. Accept, and take it back if you like

Click `[Accept]`.

![The card reads Applied; Duty is now 217.5m, marked 1 to 3](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/img/en/assistant-mcp/04-accepted.png)

1. `APPLIED`: the card's badge says how the proposal ended.
2. `Undo` (`⌘Z`) takes the whole proposal back in one step. `Restore` under your message puts the circuit back as it was before that turn.
3. `Duty` now holds 0.2175 (shown as `217.5m`).

**Answers you can see.** With a key, ask "Show me the inductor current ripple and point at the parts that set it." The reply carries a small plot of `i(L1)` over the window it measured, with its peak-to-peak in figures, and a crop of the schematic around `L1` and `C1`, which are outlined on the canvas. Point at a part name in the reply to mark it; click the plot to open the scope on that window. "Is the loop stable?" comes back with a Bode plot, "Where do the losses go?" with one bar per device, and "How does this buck work?" starts the animation with its operating modes. Chapter 12 of the manual lists them all.

## 5. The same assistant in a terminal

The command-line tool has the same assistant, for a terminal or a script. It needs the same Anthropic API key, read from the environment:

```sh
export ANTHROPIC_API_KEY=sk-ant-...
mkdir -p work
powercraft-cli chat --automation-read-root work --automation-write-root work
powercraft-cli chat -p "Open the buck example, run it and tell me the output ripple." --automation-write-root work
```

The first line opens a chat; `/save buck.voltecx` keeps the circuit in `work`. The second answers one message and exits. `powercraft-cli doctor` checks the program, the folders and the key.

Voltecx's assistant is this built-in chat: outside AI tools cannot drive Voltecx. The [manual, chapter 11](https://voltecx-web.nguyenvanqui291.workers.dev/docs/manual/11-chat-and-mcp/) covers the terminal chat, and [chapter 12](https://voltecx-web.nguyenvanqui291.workers.dev/docs/manual/12-agent-panel/) the panel.

Back to the [learning path](https://voltecx-web.nguyenvanqui291.workers.dev/docs/tutorials/).
