AI Context Panel
The AI Context panel is a docked side panel that lets you control what gets sent to AI-powered features. That includes:
- Character card sections you pin (Description, Personality, Scenario, and so on)
- Optional custom context — free-text notes you paste for this character
Pinned sections feed the Orion chat assistant and the AI toolbar (Enhance, Rephrase, Shorten, lorebook key generation, and similar ops). Think of the panel as choosing what those tools "see" when they help you write or edit.
The Agent does not use section pins. In Agent mode this panel keeps custom context and hides the pin list (pins come back when you switch to Orion). The Agent reads the card or book with tools instead.
TIP
This panel works with your configured AI provider. If you haven't set one up yet, see AI Setup.
Opening the Panel
The panel lives on the left side of the workspace. Click the AI Context button in the workspace header to open or close it. On mobile, it appears as a full-screen overlay with a close button.
How It Works
From top to bottom the panel shows:
- Usage — estimated tokens for pinned sections and custom context (when enabled), against your sampler context length. The real room for input is smaller: Context Length minus Max Tokens minus ~256.
- Custom — optional free-text block for this character (see Custom Context).
- Selected — chips for card sections currently pinned; Clear all removes section pins only.
- Section list — searchable checklist of eligible card sections. Toggle a row to pin or unpin it.
Available Sections
Not every character field appears in the context panel. These sections are excluded:
- Image (base64 data)
- Extensions
- Avatar URL
- Character version
- Tags
Sections you hide on the Sections tab are left out too. The Lorebook row appears once the character has a lorebook (even an empty one).
Section pins apply to every character. Custom context is per character.
Custom Context
Custom context is a single free-text block you can paste or type for the currently open character. Use it for notes that are not (or not yet) part of the card: world facts, style guides, reference dumps, WIP outlines, or anything else you want Orion and the toolbar to see.
Adding and editing
- Open the AI Context panel.
- Under Custom, click Add custom context… (or the pencil if you already have text).
- In the modal, paste or type your notes.
- Leave Include in AI context when enabled checked if you want it used on the next request.
- Click Save.
The modal shows a live token estimate and soft warnings when the block is large relative to your context window. Large pastes are allowed; the AI request layer still trims content when the total input exceeds the window.
Enabling and removing
- Checkbox on the Custom row — include or exclude the saved text without deleting it.
- Remove — deletes the custom context for this character (confirm first).
- Empty save (clear the textarea and save) also clears storage for that character.
What uses custom context?
| Surface | Uses custom context when enabled? |
|---|---|
| Orion (Ask AI) chat | Yes |
| Agent (character or lorebook) | Yes (source notes; it still reads the card or book itself) |
| AI toolbar (Enhance, Rephrase, Custom, etc.) | Yes |
| Lorebook ✨ key generation | Yes (same context pipeline as the toolbar) |
| AI Creation Studio | No (studio has its own flow) |
Pinned sections are sent in the order you pinned them, then custom context. When space is tight, earlier items are kept first, so core card fields take priority over custom context.
Storage and privacy
- Stored only in this browser (IndexedDB), per character.
- Not written into the character card
spec, not included in PNG/JSON export, and not part of SillyTavern-compatible card data. - Not included in snapshots/history of the card.
- Duplicating a character copies its custom context to the new card.
- Deleting a character removes its custom context with it.
- Switching characters does not leave the previous character's text in the open editor; the full body is loaded only when you open the modal or when an AI request needs it.
Export and backup
Vault Backup / card export does not include custom context, chats, or snapshots. If you rely on those notes, keep a separate copy or re-paste after moving machines. See Privacy for how local storage works.
Token Estimation
The panel shows an estimated token count for pinned sections and, when enabled, custom context. It uses a simple formula: text size in bytes divided by 4 (rounded up). This is an approximation — actual token counts vary by model.
The usage bar changes color as you approach the limit:
- Green — under 50% of context limit
- Yellow — between 50% and 80%
- Red — over 80% (shows an over-limit warning)
The context limit comes from your current sampler settings (Settings → Sampler → Context Length).
TIP
The token count shown here is an estimate. Different models tokenize text differently, so your actual usage may be higher or lower. Treat the percentage as a rough guide rather than an exact number.
Lorebook in Context
Using the lorebook with the AI Context panel works in two steps:
- Add Lorebook to context — In the section list, check Lorebook. Without this, no lorebook entries will be included regardless of their individual settings.
TIP
If you don't see Lorebook in the section list, the character doesn't have a lorebook yet.
- Choose which entries — Once the lorebook is in context, open the lorebook editor. Each entry has an eye icon that controls whether it gets included:
- Eye open — entry content is sent to Orion and the AI toolbar
- Eye closed — entry is excluded from AI context
This two-layer system means you can include the entire lorebook but hide specific entries by closing their eye icons. Or keep the lorebook out of AI context entirely while leaving all entries enabled for roleplay in SillyTavern. Disabled entries are never sent, even with the eye open.
The Agent does not use this pin/eye pipeline. It lists and reads entries on its own. New entries it adds start with the eye closed, so they do not land in Orion or the toolbar until you open it.
The lorebook editor also shows an AI context usage bar (included entry count and estimated tokens vs book budget or sampler context length), with All / None shortcuts.
How the Toggles Work Together
Each lorebook entry has two settings:
| Toggle | Used By |
|---|---|
| Enabled (main toggle) | SillyTavern and other chat interfaces during roleplay |
| Context (eye icon) | Orion and AI toolbar operations |
An entry is sent to Orion and the AI toolbar only if it is Enabled and its eye is open. Closing the eye hides an enabled entry from AI (because it is too long, irrelevant to editing, or you'd rather the AI not see it) without affecting roleplay in SillyTavern. A disabled entry is never sent.
Linked library books
You can link a book from the Lorebook Vault to a character. Linked books stay in sync with the lorebook on the card, so Orion and the AI toolbar see the same entries you would export. Entry-level context eyes still apply as above.