AI Agent
The Agent is a chat that writes the open character or lorebook. You ask for a fill, a rewrite, or a cut, and it updates the card (or book) itself. Orion only chats: it never changes the card, so copy its text into a field yourself if you want it.
TIP
The Agent needs an AI provider, same as Orion. See AI Setup.
It can use the global model from Settings → AI Config, or its own mapping on Settings → Prompts → Agent. Toolbars and Orion are separate.
It writes for real
When a run finishes, changes land in this card or book — unless review is on, in which case they wait for you. A pulsing Agent writing label in the workspace header is the cue. Use Snapshots if you need to roll back.
Orion vs Agent
| Orion | Agent | |
|---|---|---|
| Job | Brainstorm, Q&A, drafts in chat | Fill and revise the open card or book |
| Writes the card? | No | Yes, when the run finishes (or after you apply a review) |
| Context | Sections you pin, plus optional custom notes | Field and entry catalogs, plus optional custom notes. It reads bodies with tools. |
| Model | Always Settings → AI Config | Settings → Prompts → Agent, or AI Config if you leave Default |
| Where | Character workspace and lorebook vault workspace | Same two workspaces, from the robot icon in the chat header |
You can switch back to Orion at any time with the chat bubble icon next to it. The two chats do not share a thread. Each one is saved on that character or lorebook and comes back when you reopen Ask AI.
To open Agent by default, set Settings → Character Workspace → Chat panel → Default chat to Agent, and close Settings. That applies the next time you open a character or lorebook. The header switch still works for the current session.
Quick start
- Open a card.
- Open Ask AI and click the robot icon.
- Type a request, for example Write a description from my custom context.
Changes land when the run finishes. Open Snapshots to undo, or turn on review to approve edits first.
Opening the Agent
On a character
- Open the character in the workspace.
- Open the Ask AI panel (right side; header toggle).
- At the left of the chat header, click the robot icon (Agent). The chat bubble next to it (Orion) switches back. Skip this if Agent is already your default.
- Type what you want written. Enter sends; Shift+Enter adds a line.
The left AI Context panel still has custom context. Section pins hide in Agent mode; they come back when you switch to Orion. The Agent reads the card through tools, so you do not pick Description vs Personality by hand.
On a standalone lorebook
- Open a book from the home Lorebooks tab.
- Open the chat panel.
- Click Agent.
- Ask it to add or revise entries in this book.
That lorebook Agent does not edit character spec fields. For description, greetings, and the book on a card, use the character Agent.
What it can write
Character Agent
| Area | What you can ask |
|---|---|
| Card fields | Write, append to, or snippet-edit: name, description, personality, scenario, first message, examples, system prompt, post-history instructions, appearance, creator notes, creator, character version, tags, avatar URL |
| Alternate greetings | Add, rewrite, snippet-edit, reorder, or delete. Greeting 1 is the first alternate, same as the Greetings tab. First Message is its own field. |
| Embedded lorebook | Add, rename, rekey, rewrite, snippet-edit, or delete entries (name, keys, content, constant, enabled, position and depth, insertion order, secondary keys, probability, recursion flags) |
| Lorebook settings | Scan depth, token budget, recursive scanning, book name, and description |
Lorebook Agent
Same lorebook entry and settings tools as above, for the vault book you have open.
Character names
Ask for a rename or new characters without giving names, for example add her two brothers, they grew up in 1920s Kraków, and the Agent picks real names that fit the setting instead of making them up.
- Names come from lists for 44 origins, from Polish and Italian to Yoruba and Vietnamese. Japanese names come romanized (Sato, Yuko).
- It never suggests a name already on the card or in its lorebook.
- For an invented culture (a desert clan, a forest elf village) it makes up names that share one sound across the group.
Both the character Agent and the lorebook Agent do this. Give the names yourself if you already have them.
What it can check
Ask it to check the card or book and it runs read-only reports. Nothing is written.
- Audit: sizes, empty fields, duplicate keys, and
/use. On a card it also checks example dialogue: a<START>line, and a:line in each block. - Recursion map: which entries can unlock which. Asked about one entry, it also lists the links that Non-recursable or Prevent further blocks and whose flag blocks each one. It warns about entries that can never activate: Delay until recursion together with Non-recursable, or with Recursive scanning off.
- Key test: give it a line a user might write, such as we head down to the harbor at night. It lists the entries that would activate and the key that matched, plus key hits that stay off (disabled, secondary keys, delay until recursion) and why. It follows recursion when recursive scanning is on; unset counts as off, as in the editor. It is an estimate: earlier chat messages, inclusion groups, and timed effects are not replayed.
When the Agent sets one of those flags so that an entry can never activate, its write says so too.
What it does not write
- Portrait image (upload that yourself)
- The Extensions JSON blob
- The whole vault at once (it only sees the open card or book)
New lorebook entries it adds are not pinned into Orion or the AI toolbar. Open the entry eye if you want them in that context. They still export on the card or book.
If the character has a linked library book, lorebook writes on the character Agent also update that library book when the run finishes.
Custom context
Optional source notes (world bible, outline, paste dump) live in AI Context → Custom. Enable the block if you want the Agent to treat it as material. It is still vault-local: not on the PNG/JSON card, not in SillyTavern fields.
The Agent prefers filling empty fields and staying consistent with those notes. You do not have to pin card sections.
Details: AI Context → Custom Context.
Skills
A skill is a set of instructions for one kind of task, such as writing greetings or tightening prose. Each skill has a name, a when to use line, and the instructions.
The Agent sees only each skill's name and when-to-use line. When your request matches one, it loads that skill's instructions and follows them, and its reply shows Used skill “Name”. To pick a skill yourself, type @ and choose it, for example @Cut AI Slop.
Three skills come with the app:
| Skill | When to use |
|---|---|
| Greeting Writer | Writing or revising the first message or alternate greetings |
| Lorebook Entries | Adding lorebook entries or revising their keys or bodies |
| Cut AI Slop | Cleaning up, de-slopping, or tightening prose in the card or book |
Skills are settings, not part of a card. Both Agents share them, they stay in this browser, and they are included in a settings backup.
Managing skills
Open Settings → Agent Skills.
- Use skills at the top turns all skills off or on. Each skill keeps its own switch and text while they are off.
- The switch on a row turns that one skill off without deleting it.
- Click a row to edit its name, when-to-use line, and instructions. The token count is what the instructions cost when the Agent loads them.
- New adds a skill at the top. A new skill you close without typing anything is dropped.
- An edited default skill gets Reset to default. If you delete a default, Add back restores it.
Writing a skill
- The when to use line decides when the Agent loads the skill, so make it specific: Use when writing or revising alternate greetings works better than Greetings.
- Write the instructions as steps and rules, with a short example if it helps. Keep them to one task.
- You can tell the Agent which tool to use, for example read_field description before writing. Agent tools glossary, under the skill list, lists every tool the Agent can call with a one-line summary. Click a name to copy it. Tools marked Card only or Lorebook only exist in just one of the two Agents.
How a run works
- You send a request.
- The Agent sees catalogs (field ids and sizes; lorebook ids, names, and keys) plus custom context if enabled. It reads full bodies only for what it is about to change.
- It calls tools (list, read, search, update, replace, find-and-replace across the whole card or book, add, delete). The chat shows short colored tool lines, not the full field text.
- When it is done (or you Stop), CharacterVault writes once and takes one snapshot first — or, if review is on, it stages those writes for you to approve.
Until that write (or until you apply a review), the editor keeps the previous text. A pulsing Agent writing label in the workspace header is the cue.
You can keep editing while it runs. The write only covers what the Agent changed, so your edits to other fields, greetings, and entries stay. If you both changed the same one, the Agent's version wins and yours is in the snapshot taken just before the write.
Snippet edits match a unique stretch of existing text instead of rewriting the whole field or entry. Matching tolerates quote styles and multi-section spans. If the snippet is not unique, ask it to re-read and copy a longer stretch.
The Agent needs a model with tool calling (OpenAI-style tools). If the provider rejects tools for the selected model, the run stops with an error asking you to pick a model that supports them.
Catalogs in the prompt are built at the start of the run. After names or keys change, the Agent can list again in that same run. The next Send rebuilds catalogs from the saved card.
The Agent remembers earlier requests in the same chat. Each past run carries a short note on what it changed, whether you applied or discarded its review, and whether it hit the turn limit, so “undo that” or “do the same for greeting 2” work. Full text is never resent; the Agent reads the current card again when it needs to. New chat starts over.
Remember earlier edits
To let the Agent see exactly what it wrote in earlier runs, turn on Settings → Character Workspace → Agent edits → Remember earlier edits in the chat (off by default). Each earlier run's edits then go back to the Agent as the calls it made, so reword the second sentence you just wrote works without a search.
- The character and lorebook Agent share this setting. It also covers runs from before you turned it on.
- Interrupted runs, runs saved before 1.8.5, and runs larger than a quarter of the input budget still get the short note.
- With a thinking model, each replayed run also carries the last part of its thinking, which models such as DeepSeek and Kimi require. It is sent only to the model that wrote it.
- The replayed edits count toward the context meter. Turn it off if long threads crowd a small context.
What you see in chat
- Tool lines: each reply lists what the Agent did. Writes are green, failures red, and what it looked at is grey, such as Read Description, Read “Harbor” (#4), Searched “harbor” (3 matches), or Checked the card. Click a write or a read to open that field, greeting, or lorebook entry. A lorebook write that changed nothing reads No change to ….
- Grouped steps: back-to-back steps where the Agent only ran tools, with nothing to say and no shown thinking, appear as one block with one time. A row that repeats shows once with a count, such as Read Examples ×3.
- Write recap: speech from a turn that also called tools stays on the message. If there was no speech, Applied N writes sits above the tool list. Writes that changed nothing are not counted.
- Used skill: a reply that loaded a skill lists Used skill “Name”, and the spinner reads Reading skill “Name” while it loads.
- Status line: while a tool runs, the spinner names what it is working on, such as Updating Description, Reading entry “Harbor”, or Searching “harbor”. An entry added earlier in the same run shows by id (entry #4).
- Turn limit: a run that stops at the loop-turn cap says so on its last message, with a Continue button that sends “Continue where you left off.”
- Starter suggestions: an empty chat offers a few first requests based on what the card or book is missing, such as Write a description, Write 2 alternate greetings, or Build a lorebook from my custom context. It never suggests Appearance, Personality, Scenario, System prompt, or Post-history. A finished card gets the usual Audit this card style chips.
- Header: a shield icon means review is on, and a yellow Review N button means a proposal is waiting. New chat is the speech bubble with a plus.
- Finished in the background: if a run ends while you are on another tab or in another app, the page title starts with Agent finished until you come back.
- Thinking: streams in an expanded Thinking fold while it is live; after the reply it collapses
- Live token count: catalogs, custom context, and the current prompt (including tool results)
- TTFT / t/s: on the assistant message info tooltip when the reply finishes, same as Orion
- Cache: the same tooltip shows Cache: hit (N tokens) or Cache: miss when the host reports prompt cache counts, see Prompt caching
- Reads keep only their one-line summary in the chat; the full field or entry text counts in the live meter, then drops out of the transcript
The thread is stored in the browser with the vault. Long threads keep a small window on screen; Load earlier messages pages older turns back in. Oldest rows drop past 500 saved messages per panel.
Chat controls
- Stop (square while it is working) cancels the current run. Writes that already finished in that run still flush.
- Send with an empty box retries the last request (same as the composer hint).
- New chat asks first, then clears the saved thread for this panel only. The card stays as last written. Closing the panel or leaving the card keeps the conversation. It is hidden while a review is pending.
- While a review is pending, the composer is disabled. Apply or discard the proposal first.
- Edit (the pencil on your last message) puts its text back in the box. Nothing is removed until you send; then that message and the replies after it are replaced. The × cancels and keeps the chat as it was.
- Delete a message to trim from that point; you cannot edit or delete while a run is in progress.
- @-mentions: type
@to pick a field, alternate greeting, lorebook entry, or skill. It inserts plain text such as@Description,@Greeting 2,@“Harbor” (#4), or@Cut AI Slop, highlighted in the message box, and the Agent reads it as that item. ↑ / ↓ move, Enter or Tab picks, Esc closes the list.
If you Stop while it is still thinking, Send is available again so you can retry or type a new ask.
Leaving mid-run
A run only writes when it finishes, and a waiting review only writes when you apply it. So refreshing or closing the tab while a run is going, or while a review is waiting, makes the browser ask first. That also happens with the tab in the background. With the Agent idle, the page leaves without asking.
If you leave anyway (refresh mid-run, refresh with a review waiting, or go back to the library with a review waiting), those edits are lost. When you reopen the chat, that run says Interrupted by leaving or refreshing the page. Its write lines show struck through as Not saved, and the Agent is told nothing from that run landed. Ask again to redo the work.
Context meter
The Agent chat shows estimated tokens for catalogs, custom context, and the live prompt while a run is going. Lookup reads (full field or entry bodies) count in that live number, then drop out of the transcript so the thread does not keep those bodies.
Idle, the meter is catalogs + custom context + what is still in the chat. Raise Settings → Sampler → Context Length if large books run close to the limit.
The estimate counts the tool definitions the Agent sends. The Agent runs with a context length of at least 64,000 tokens even when the sampler is set lower, so a small window no longer leaves the Agent no room for its own reads. See Prompt caching.
The sampler Max Tokens slider does not cap Agent output the same way. Agent completions use a larger output budget so tool calls are less likely to cut off.
Prompt caching
An Agent run resends the same prompt on every turn, so the provider can read most of it back from its prompt cache instead of billing it twice. There is no setting for this: it is on for every Agent run.
- Claude on OpenRouter: every Agent request for a Claude model is marked cacheable. NanoGPT caches Claude on its own, so no marker is sent there.
- One prefix per run: when a run outgrows its input budget, the oldest exchanges are dropped down to 75% of it and that cut is kept, so the next turn appends to the same prefix instead of moving it every turn.
- Hit or miss: the info button on an Agent reply shows Cache: hit (10,400 tokens) or Cache: miss when the host reports its counts. A host that does not report them shows nothing.
- Tools count: the tool definitions are part of the token estimate, so the context meter and the trimming behind it match what is actually sent.
- 64K floor: the Agent runs with a context length of at least 64,000 tokens, even when Settings → Sampler → Context Length is lower. Below that, the system prompt and the tools alone eat the budget and the Agent forgets what it already read.
On OpenRouter, Always use Exacto for the Agent can switch hosts partway through a run, which loses cache hits. Pin a host or set Host priority to Cheapest when cache hits matter more. See AI Setup → Exacto and the Agent.
Model for Agent
On Settings → Prompts, the Agent card at the top uses the same picker as toolbar ops:
- Default (AI Config) to keep the global model
- Or pick an endpoint you already configured and a model id
- Or pick a saved preset under Saved, which sets both
Keys stay on AI Config. The mapping applies as soon as it saves. Character Agent and lorebook Agent share this one mapping.
The Agent is not Orion with extra buttons. It has to emit valid tool calls, often several in a row. A model that chats well can still fail here.
Point Agent at a current tool-calling / agentic model. Leave a cheap chat model on AI Config for Orion and Fix if you want; do not make the Agent use that same model.
On OpenRouter, Agent tool calls already go to the hosts with the most reliable tool calls (Auto Exacto) unless you set a host priority. To keep that with a host priority set, and for the prompt-caching trade-off, see AI Setup → Exacto and the Agent.
See AI Setup → Prompts Tab. If tool calls fail, see Troubleshooting.
Limits (per run)
If a job is huge, send a second ask for the rest.
| Cap | About |
|---|---|
| Field updates | 30 |
| Greeting add/update/delete | 20 |
| Lorebook adds | 50 |
| Lorebook updates (each update, replace, or book-settings change counts) | 150 |
| Lorebook deletes | 50 |
| Tool calls in one model reply | 24 |
| Loop turns | 32 |
| Find-and-replace across the card or book | 10 |
A run that reaches the loop-turn cap stops with a note and a Continue button. Continue starts a new run that picks up where it left off.
Duplicate lorebook names in one run revise the new entry instead of adding a second copy. Names that already existed in the book are rejected; ask it to update that id.
Review edits
By default the Agent applies writes when the run finishes. To inspect them first:
- Open Settings → Character Workspace.
- Enable Review agent edits before applying. It saves automatically.
A shield icon in the chat header shows while this is on. Character Agent and lorebook Agent share the same preference.
When a run that changed something finishes, Review agent edits opens instead of writing:
- Each field, greeting, and lorebook change is a row with an Original / Agent diff and
+added/−removedword counts. On wider screens the two sides sit next to each other, aligned line by line; on phones the diff is one inline column. Reworded lines highlight only the words that changed. Runs of unchanged lines fold behind Show N unchanged lines. Lines that changed too much, and very long texts, show as whole removed and added lines. - Greeting changes are labeled: an added greeting shows as New alternate greeting with an empty Original, a deleted one as Deleted alternate greeting, and a Greetings list rewrite shows per-greeting blocks with
+N/−Ngreeting counts and New / Removed badges. When editing a Greetings list change, separate greetings with a line containing only---, or a longer dash line when a greeting already has a---scene break. The hint under the box shows which. - A lorebook row lists each entry setting the Agent changed above the content diff, such as Non-recursable: on → off or Position: Before Character → At Depth, with the same names as Snapshots.
- Approve or deny per change. Approve all / Deny all set every row. Denied rows stay in the list but are not applied.
- Expand an approved change to edit the proposed text (and lorebook keys) before it lands.
- Apply N takes one snapshot, then writes only the approved rows (it is disabled when nothing is approved). Discard all throws the whole proposal away after a Confirm discard step.
- Close the modal or click outside to decide later. The yellow Review N button in the chat header reopens it. Send is blocked until you apply or discard.
Apply writes on top of the card as it is now. Edits you made in the editor meanwhile stay, unless the Agent changed the same field; then the approved Agent version wins and yours is in the snapshot Apply takes first. New lorebook entries get a free id if you added one yourself while the review was open.
Turn the toggle off to go back to applying writes automatically (the default).
Snapshots
Before the Agent writes (or when you Apply a review), CharacterVault stores one snapshot of the current card or book (if something actually changed). Opened card / Opened stays last in the list and cannot be deleted.
Open Snapshots in the workspace header (character or vault book) to compare and restore. Linked characters follow a restored library book, same as a manual restore.
Tips
- Put source notes in custom context, then ask for a fill or a pass (thin description, rename keys, add missing entries).
- Prefer one clear job per Send. Split “rewrite description” and “rebuild the lorebook” if either is large.
- Stop, then empty Send, retries the last user message.
- After a run, skim Snapshots if the write was bigger than you meant. Turn on review if you want that skim before the write.
Troubleshooting
Most “the Agent is broken” reports are the model. CharacterVault can only run the tools the model actually calls. If the model cannot do function calling, no setting will save the run.
Tool calls fail, loop, or never write the card
TIP
Switch to a newer model that is trained for tools. That is the fix.
A small chat model, a roleplay finetune, or last year’s instruct weights will invent XML, call tool_name, skip tools and “helpfully” dump prose, or loop the same empty call. That is expected. Those models were not trained for this job.
Size is not enough. An old 70B chat model still loses to a current ~27B that was post-trained for agents. Qwen3.8-27B (released August 2026) is a dense open-weight example that handles this Agent well, including the Thinking listing on NanoGPT. Hosted names look like qwen3.8-27b / qwen3.8-27b:thinking (NanoGPT) or qwen/qwen3.8-27b (OpenRouter). Fetch the catalog; do not type a guessed slug.
Other current families that are actually built for multi-step tool use (as of August 2026):
| Family | Why it belongs here |
|---|---|
| Qwen3.8 | Qwen3.8-27B for a compact pick; Qwen3.8-Max if you want the flagship |
| DeepSeek V4 | V4 Pro (or Flash if you need cheaper / faster) |
| GLM-5.3 | Current GLM coding/agent stack; GLM-5.2 is the previous one |
| Kimi K3 | Current Kimi flagship; older K2.5 / K2.6 are a generation behind |
| GPT-5.6 / Claude Opus 4.8 class | Fine via OpenRouter or another compatible gateway if you already pay for them |
| Gemma 4 (local) | Native tool calling across the lineup, including the small E2B / E4B cuts. See Local models. |
Do not use for Agent:
- Small chat/instruct models with no tool-calling post-training (generic 7B–8B chat is not the same as Gemma 4 E2B / E4B)
- Roleplay, NSFW, or “uncensored chat” finetunes unless you have already seen them emit clean native
tool_callson a real Agent run - Older lines: Llama 3.x chat, Qwen2.5, Qwen3 8B/14B as your daily Agent, DeepSeek V3 / V3.1 / V3.2, GLM-4.x, Gemma 3
- Cheap mini / nano / flash SKUs sold for one-shot chat, unless the provider lists tools and a real Agent pass works
Orion can stay on a weaker model. Map Settings → Prompts → Agent to one of the families above and run again.
Local models
Local works if you pick models that were trained for tools. Point Settings → Prompts → Agent at your local endpoint (LM Studio, llama.cpp, Ollama, and so on).
Gemma 4 is the example. The whole lineup can call tools, including the small E2B and E4B cuts. E4B is already useful in practice (a pass that rekeys a dozen lorebook entries is in range). 12B, 26B-A4B, and 31B hold up better as the job gets larger.
TIP
More parameters plus tool-call training just works better. A 4B that knows tools will beat a 70B that does not. Between two tool-trained models, the bigger one is the safer pick for a full card or a whole-book rewrite.
The Agent talks instead of editing
It is chatting. A tool-capable model reads catalogs and calls list / read / update / replace. If you only get a paragraph in the chat and no colored tool lines, the model did not call tools. Same fix: newer tool-calling model.
incomplete_action or cut-off tool JSON
The model started a call and ran out of output, or emitted broken JSON. CharacterVault salvages truncated native calls when it can, then asks the model to finish. If that keeps happening:
- Prefer a current tool-calling model (Qwen3.8, DeepSeek V4, GLM-5.3, Kimi K3, or Gemma 4) over a chat-only instruct
- Split the job, or step up a size, if a small local keeps cutting off (“rewrite description” vs “rebuild the lorebook”)
Agent output is not capped by the Sampler Max Tokens slider; raising that slider will not fix a model that cannot close a call.
Context meter is full / prompt too long
Raise Settings → Sampler → Context Length. Huge books plus custom context plus a long thread will crowd the window. Start New chat if the thread is old; the card stays as last written. Lookup bodies count in the live meter, then drop out.
Changes never appear in the editor
The Agent writes once, when the run finishes (or you Stop, for tools that already completed) — unless review is on, in which case nothing lands until you Apply. The Agent writing header label is the cue. If the run ends with no tool lines, nothing was applied. That is a model/tool failure, not a delayed save.
If Send is locked and you see a yellow Review N button, a proposal is waiting. Open it and apply or discard.
Lorebook writes did not reach the vault book
The character must have a linked library book. Unlinked card books stay on the character only.
Wrong greeting number
Greeting 1 is the first alternate, same as the editor. First Message is a separate field. Ask for “greeting 1” or “first message” explicitly, or pick it with @.
Next Steps
- AI Assistant Orion (chat that does not write the card)
- AI Context Panel
- Configure the Agent model
- Snapshots & Rollback
- Greetings Editor
- Lorebook Editor
- Lorebook Vault