Contexts
Conditional sentences injected into the chat prompt to ground the AI in scene state.
A context is a sentence (or short paragraph) added to the chat prompt just before the character's reply — describing the current scene, pose, mood, or environmental fact.
Example:
{{ char }} wears a blindfold and cannot see {{ user }}.That sentence is rendered into the prompt on every turn where its condition is met. The AI uses it to inform the next reply.
Structure
| Field | What it does |
|---|---|
| Context | The text template. Use Scriban syntax — {{ char }}, {{ user }}, {{ scenario_chars.role }}, etc. |
| Conditions | A flag-based condition. The context only appears when the condition is true. See Flags. |
Style guide
- Always third person referring to the character:
{{ char }} is sitting on the couch. - Keep contexts short — one or two sentences. Long contexts eat prompt budget on every turn.
- Be specific — "tired" is weaker than "exhausted from running for hours."
- One fact per context. Easier to toggle individually based on state.
Interface
- Reorder — contexts render in display order. Group related contexts together for legibility in the prompt.
- Edit / delete standard.
- Toggle off to temporarily disable for testing without deleting.
- Search the context list by content.
- Test flags field — set hypothetical flags and see which contexts would activate. Indispensable when debugging "why isn't the AI acknowledging X?" questions.
When to use what
| Use case | Use this |
|---|---|
| "The character should always know fact X." | Character profile, not a context. |
| "The character should know fact X when state Y is true." | Context with flag condition. |
| "The character should react to fact X happening once, right now." | Note or chat.note() from a script. |
| "The character should know X but not the user." | Secret. |
| "Rich background lore that should activate when relevant." | Memory book. |