Skip to main content

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_NAME 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.

LevelWhere it livesTypical use
InstanceApp instance (device, kiosk, embedded experience)Defaults shared by everyone on that device, e.g. STORE_NAME, LANGUAGE
ConversationA single chat threadPer-user or per-session data, e.g. USER_NAME, TICKET_ID

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​

  1. Open the Skills page (or the agent's Skills tab) and edit a skill (or create one).

  2. In the skill content (Markdown), write placeholders where you need dynamic text:

    # Customer greeting

    Hello {{USER_NAME}}, welcome to {{COMPANY}} support.
    When you answer, always refer to the customer as {{USER_NAME}}.
  3. 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​

  1. Open a conversation with your agent.
  2. Click Context (key icon) at the top of the conversation.
  3. In the side panel, add one row per variable:
    • Key β€” e.g. USER_NAME
    • Value β€” e.g. Marie
  4. 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.

tip

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.):

  1. Go to the agent's Applications tab.
  2. Open the application, then its Instances tab.
  3. Click Context on the instance. The Instance context dialog opens.
  4. 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:

  1. Open the Context panel.
  2. 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).
  3. Enter the key and value.
  4. 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

  1. Open Context in the chat.
  2. Remove the row for the variable you no longer need (delete icon on the row), or clear the key and value and save.
  3. 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

  1. Open the instance's Context dialog in the application's Instances tab.
  2. 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_EMAIL rather than 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​

  1. Create a skill Meeting prep with: Prepare talking points for {{CLIENT_NAME}} about {{TOPIC}}.
  2. Assign the skill to your agent.
  3. In a test chat, open Context and set CLIENT_NAME = InTech and TOPIC = Q3 roadmap.
  4. 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_NAME on the instance once; only add per-visitor keys like VISITOR_NAME in each conversation.