Skip to main content

Context and variables

Overview​

In Moveo, store temporary information during a conversation using context variables. These variables apply only to a specific conversation and are automatically deleted once the conversation ends. Context is a collection of key-value pairs that help AI agents make decisions, store state, and enhance dialog interactions.

Context variables can be set at different levels:

  • Environment level (see Context Bundles)
  • Agent level (within AI agents and dialogs)

Additionally, context can store user-related information, such as their name, email, or other relevant data.

Types of context variables​

Dialog variables​

Create and store variables within a dialog using questions. These variables are flexible and can be named as needed.

User variables​

User-related information is stored in specific system-defined variables, including:

  • $user.display_name: User's name
  • $user.email: User's email address
  • $user.user_id or $user.external_id: Unique user ID (depends on the communication channel)

Some user variables, such as user IDs, are automatically assigned by the system, while others require manual input via questions or forms at the start of a conversation.

warning

User variables cannot be set directly. To assign a value using a Set Variable action, select the appropriate key (for example, $user.display_name).

For webhook responses, refer to the Webhook reference.

System variables​

Moveo provides system-generated variables that contain essential metadata about the conversation:

VariableDescription
$sys-channelCommunication channel of the conversation
$sys-unknown_counterNumber of times a fallback was triggered
$sys-businessIndicates if the conversation occurs within business hours
$sys-deskIdentifies the conversation environment
$sys-sessionUnique conversation ID
$sys-user_message_counterNumber of messages sent by the user
note

The $sys-unknown_counter variable is zero-indexed, meaning the first unknown response occurrence is stored as 0.

Bundle variables​

Import variables from Context Bundles associated with different environments. These variables follow the format: {{$global.bundle.variable}}.

Tags​

Tags assigned by the AI agent during a conversation are stored in $tags as a list. For example, if the assistant assigns location and hours tags, $tags contains ['location', 'hours'].

This variable is useful for:

  • Filtering conversations in Analytics
  • Triggering specific actions using Rules
  • Enhancing human-agent interactions (agents can manually assign tags)

To add a new tag, use the Add Tag dialog action.

Live instructions​

The live_instructions variable allows real-time updates to the AI agent, guiding its behavior dynamically based on external input.

Cc recipients for email​

On an email conversation, two context variables set the Cc recipients of the AI agent's replies:

VariableWho sets itWhat it holds
$channels.email.ccMoveo, on each inbound emailThe Cc and other To recipients of the last inbound email
$email_ccYou, with a Set variables action or a webhookExtra Cc recipients for the AI agent's replies

Both variables hold one comma-separated string, like the Cc field of an inbox: ana@example.com, billing@example.com.

Each AI agent reply copies the addresses in $channels.email.cc first, then the addresses in $email_cc. Moveo removes repeated addresses and the address that the reply goes to.

Moveo replaces $channels.email.cc on each inbound email. The value lists the Cc recipients and any To recipients other than your AI agent's address. Moveo keeps the first 10 addresses, in lowercase, without display names. An inbound email with no Cc and no other To recipient sets the value to an empty string. A webhook or a Set variables action cannot change this variable.

$email_cc follows these rules:

  • It holds at most 10 addresses and 1,024 characters. Moveo ignores empty entries.
  • Each entry is one bare address, such as ana@example.com. A display name, such as "Ana Lopez" <ana@example.com>, is not valid.
  • When one entry is not valid, Moveo rejects the whole value and keeps the previous one.
  • An empty string removes all the addresses.
  • The value stays when a new inbound email arrives, even an email without Cc.
note

Human agent replies copy only the addresses in $channels.email.cc. The $email_cc addresses go on AI agent replies only.

Using context in dialogs​

Context variables enable various dialog functionalities, such as:

  • Setting new variables
  • Updating existing ones
  • Deleting variables
  • Making decisions using conditions (Learn more)

For example, you can check whether a user has provided their email and prompt them accordingly if it's missing.

Ways to set context variables​

Using context variables​

Reference variables in the dialog by using {{$variable}}.

For example:

Hello {{$user.display_name}}, how can I assist you today?

Refer to the documentation for more guides on handling context variables effectively.