Skip to main content

Context bundles

Context bundles automatically import variables into the conversation. To open the context bundles menu, select an environment.

Uses of context bundles​

Context bundles help in many scenarios, such as:

  • Different variable values for different languages
  • Webhook variables that you can edit at any time without changing code
  • Different information within the same AI agent, depending on the environment

Add a context bundle​

  1. Open your environment and select the Context bundles tab.
  2. Select Add.
  3. Enter a Name and, optionally, a Description. Then select Create.
  4. Enter each variable key and its value.
  5. Select Save and close.
The Greece context bundle with the keys country, currency, support_phone, and store_hours and an empty row for a new key.The Greece context bundle with the keys country, currency, support_phone, and store_hours and an empty row for a new key.

Upload a context bundle​

Upload your context bundle from a JSON file. Two methods are available:

Import a new bundle​

You can import your context bundle the same way that you import an AI agent. Enter a name and a description, and select your JSON file to import it as a separate bundle.

Merge bundle​

Upload your bundle into an existing one to merge all variables. When a variable conflicts, either keep the original value or replace it with the uploaded one.

Use a context bundle​

After you create a context bundle, you can use it in your AI agent as context variables. To do this, first apply the context bundle to the conversation with a rule, and then you can use the variables in a dialog.

Apply a context bundle​

  1. Go to Deploy → Rules.
  2. Select + Create.
  3. Select the conditions that apply the context bundle.
  4. In Actions, select +, and then select Apply bundle.
  5. Choose the context bundle you want to apply.
  6. Depending on your conditions, you may want to assign an AI agent too.
  7. Activate the rule.
  8. Save changes.
A rule with the condition Language is Greek and the Apply bundle action that applies the Greece bundle.A rule with the condition Language is Greek and the Apply bundle action that applies the Greece bundle.

Use the variables​

In a dialog, you can use the variables from the context bundle by using the {{$global.bundle.variable_name}} syntax. For example, if you have a variable name in your context bundle, you can use it in a dialog like {{$global.bundle.name}}. If you use the variable before the rule applies the context bundle, it shows as %UNKNOWN in the conversation, the same as any other variable.

Every bundle has a preset property bundle with its name, so you can use it in your dialog as {{$global.bundle.bundle}}. This can be useful to differentiate between different bundles in the same dialog using conditions.

Next steps​