Variables
The Variables page in the admin interface allows for the creation, management, and configuration of variables. These variables are used throughout the AI agent system to store data, control flow, and personalize interactions.
- The
account Selection
is used to filter variables by account. - The
agent Selection
filters variables to show only those associated with the currently selected agent.
Using Variables
Variables can be used to store, retrieve, and manipulate data within your agent's interactions. They can be referenced/embedded in prompts, intents, APIs, scripts, and more.
Variable Usage
- General Variables: Use
{var["<variable-name>"]}
or{var['<variable-name>']}
to reference any created variable. - Example:
Hello {var['first_name']}, how can I help you?
- User Input: Use
{user_input}
to directly insert the user's latest message. - Special System Variables: The system provides several read-only variables with context about the conversation these include:
{conversation_text}
- Full conversation history.{var["sessionDateTime"]}
- The current date and time of the session.{var["intentNameList"]}
- List of all possible intent names.{var["noInputIntentNameList"]}
- List of all intent names that are not input types. Good for 'what do you do type questions'.{var["inputIntentNameList"]}
- List of input type intent names.{var["intent_resp"]}
- The currently classified intent.{var['expectedInput']}
- If an input is requested by an intent, this field will populate, otherwise empty. This can be a useful 'hint' for the LLM during intent classification.
Permissions
Access to the Variables page and its functionalities is generally controlled by user permissions. Users with owner
, admin
, editor
, or variables
permissions can typically manage variables.
Adding a New Variable
To create a new variable:
- Navigate to the Variables page.
- Ensure an account is selected, as variables are associated with an account.
- Expand the "New Variable" section.
- A form will appear with the following fields:
- Variable Name: A unique name for the variable (cannot contain spaces).
- Starting Value: The initial value for the variable.
- Status: A toggle to set the variable as active (default) or inactive.
- Show to Live Agent: A toggle to determine if this variable and its value should be visible to a live agent in their interface (default: False).
- Refresh at Input Request: A toggle (default: False). If true, the variable will be re-asked and reset whenever an input is requested that might populate this variable.
- Agent(s): A multi-select field to associate this variable with one or more AI Agents.
- Variable Type: A dropdown to select the data type of the variable (e.g., "string", "integer", "float", "boolean", "list", "dictionary", "json").
- Variable Scope: A dropdown to define where the variable is primarily used or relevant (e.g., "session", "intent", "prompt", "global", "api", "script").
- Global variables are immutable and hidden from direct output in some contexts.
- Intent variables are often used for user input classification.
- Session variables can store data fields for the duration of a user's session.
- Other scopes help organize variables for specific components like prompts, APIs, or scripts.
- Click the "Create Variable" button. The system checks if the variable name contains spaces before saving.
Listing Variables
Existing variables for the currently selected account and agent are displayed in a list:
- Filter by Variable Scope: A dropdown allows filtering variables by their scope (e.g., "session", "intent").
- Each variable is shown in an expandable section.
- The display includes the variable name, scope, status (active/inactive), and associated agents.
- Expanding a variable's section reveals:
- Starting Value: Displayed as "****" for "global" scope variables for security.
- Type
- Scope
- Show to Live Agent status
- Refresh on Input Request status
- Each variable entry has "Edit" and "Delete" buttons.
Editing an Existing Variable
To modify an existing variable:
- Click the "Edit" button next to the desired variable in the list.
- The "Edit Variable" form will appear, pre-filled with the variable's current information.
- The following fields can be modified:
- Variable Name (cannot contain spaces)
- Starting Value (masked as a password field if scope is "global")
- Status
- Show to Live Agent
- Refresh at Input Request
- Agent(s)
- Variable Type
- Variable Scope
- Buttons available within the edit form:
- Save Changes: Saves the modifications to the database.
- Cancel: Discards changes and closes the edit form.
Deleting a Variable
To delete a variable:
- Click the "Delete" button next to the desired variable in the list.
- The system will attempt to remove the variable record from the database.
- A success or error message will be displayed.
Associating Agents with Variables (Add Agent to Variable)
If an agent is selected, an additional form appears:
- "Available Variables for [Selected Agent Name] Agent:": A dropdown lists variables from the current account that are not yet associated with the selected agent.
- Clicking "Include Variable" will add the selected agent to the
variable_agents
array of the chosen variable, effectively linking them.