Context variables
Context variables let you personalize what an agent says and does without rewriting your skills or prompts for every user, session, or device. You define named values (for example USER_ or COMPANY) and reference them with placeholders like {{USER_NAME}} in a skill or in the agent's initial prompt.
When the agent runs, Breign replaces each placeholder with the matching value. Values can come from the current conversation (chat) or from an app instance (kiosk, embedded app, etc.).
What you can personalizeβ
- Skills β instructions loaded dynamically by the agent (for example a CRM skill that greets {{USER_NAME}}).
- Initialization instructions β the agent's base instructions. See Persona and instructions.
- Every message β replacements are applied again on each LLM call, so you can update variables mid-conversation.
Key formatβ
Each variable has a key and a value.
- Keys must use only uppercase letters, digits, and underscores:
A-Z,0-9,_. - Good examples:
USER_,NAME ORDER_,ID SITE_.CODE - Invalid examples:
user-name,UserName,ma-clΓ©.
Placeholders in text always use double curly braces around the key: {{USER_NAME}}.
Two levels of contextβ
Breign stores context variables at two levels. When both define the same key, the conversation value wins.
| Level | Where it lives | Typical use |
|---|---|---|
| Instance | App instance (device, kiosk, embedded experience) | Defaults shared by everyone on that device, e.g. STORE_, LANGUAGE |
| Conversation | A single chat thread | Per-user or per-session data, e.g. USER_, TICKET_ |
Instance variables are configured on an instance of one of the agent's applications. Conversation variables are configured from the chat itself, or afterwards from the conversation history.
Use variables in a skillβ
-
Open the Skills page (or the agent's Skills tab) and edit a skill (or create one).
-
In the skill content (Markdown), write placeholders where you need dynamic text:
# Customer greetingHello {{USER_NAME}}, welcome to {{COMPANY}} support.When you answer, always refer to the customer as {{USER_NAME}}. -
Save the skill and assign it to your agent if needed.
While editing, Breign detects placeholders in the content and shows a small badge with the number of variables used. The editor also lists the detected keys so you know which values to provide later.
Use variables in a chatβ
- Open a conversation with your agent.
- Click Context (key icon) at the top of the conversation.
- In the side panel, add one row per variable:
- Key β e.g.
USER_NAME - Value β e.g.
Marie
- Key β e.g.
- Click Save.
The badge on the Context button shows how many variables are configured. If a skill expects variables you have not filled in yet, you can click the violet badge on that skill to open the same panel with the suggested keys.
Variables attached to the conversation override instance variables with the same key.
Save your variables before sending a message. If required placeholders are still empty, Breign may block the send and ask you to complete the context first.
Configure instance variables (apps)β
For agents deployed as apps (kiosk, web embed, etc.):
- Go to the agent's Applications tab.
- Open the application, then its Instances tab.
- Click Context on the instance. The Instance context dialog opens.
- Click Add a key, enter keys and values, then save.
These values apply to every new conversation on that instance until you change them. Users can still override them per conversation from the chat Context panel.
Create a variableβ
Whether you are in a chat or on an instance:
- Open the Context panel.
- Add a row: Add a key in the instance dialog, Add variable in the conversation history (or use the empty row if one is already shown).
- Enter the key and value.
- Save.
You can add as many variables as you need. Keys must be unique within the same context (conversation or instance).
Delete a variableβ
From a conversation
- Open Context in the chat.
- Remove the row for the variable you no longer need (delete icon on the row), or clear the key and value and save.
- Click Save if you only cleared fields without using the delete action.
Removing a variable from the conversation does not delete instance-level variables with the same key; the instance value will apply again if it exists.
From an instance
- Open the instance's Context dialog in the application's Instances tab.
- Remove the row or clear the key, then save.
See which variables were usedβ
In the agent's History of conversations, open a conversation. You will find:
- Context variables β values stored on that conversation. You can edit them there and Save.
- Instance context β values defined on the instance.
- Context used β the merged result actually injected into the prompt (instance + conversation, with conversation winning on conflicts).
This is useful for support and debugging without reading raw technical logs.
Good practicesβ
- Use clear, stable key names (
USER_rather thanEMAIL EMAIL1). - Prefer instance context for settings that rarely change (site, language, product line).
- Prefer conversation context for data tied to the current user or session.
- Define variables before testing a skill that depends on them, or click the skill's context badge to fill them quickly.
- If a placeholder stays visible in the agent's answer ({{USER_NAME}} instead of a name), the variable is missing or the key name does not match exactly (keys are case-sensitive).
Example workflowβ
- Create a skill Meeting prep with:
Prepare talking points for {{CLIENT_NAME}} about {{TOPIC}}. - Assign the skill to your agent.
- In a test chat, open Context and set
CLIENT_=NAME InTechandTOPIC=Q3 roadmap. - Ask the agent to use the meeting prep skill β it receives the resolved text with real names, not placeholders.
For a kiosk that always serves the same store, set STORE_ on the instance once; only add per-visitor keys like VISITOR_ in each conversation.