GETTING STARTED
Kore.ai XO Platform
Virtual Assistants Overview
Natural Language Processing (NLP)
Concepts and Terminology
Quick Start Guide
Accessing the Platform
Navigating the Kore.ai XO Platform
Building a Virtual Assistant
Help & Learning Resources
Release Notes
Current Version
Recent Updates
Previous Versions
Deprecations
Request a Feature
CONCEPTS
Design
Storyboard
Overview
FAQs
Conversation Designer
Overview
Dialog Tasks
Mock Scenes
Dialog Tasks
Overview
Navigate Dialog Tasks
Build Dialog Tasks
Node Types
Overview
Intent Node
Dialog Node
Dynamic Intent Node
GenAI Node
GenAI Prompt
Entity Node
Form Node
Confirmation Node
Message Nodes
Logic Node
Bot Action Node
Service Node
Webhook Node
Script Node
Process Node
Agent Transfer
Node Connections
Node Connections Setup
Sub-Intent Scoping
Entity Types
Entity Rules
User Prompts or Messages
Voice Call Properties
Knowledge AI
Introduction
Knowledge Graph
Introduction
Terminology
Build a Knowledge Graph
Manage FAQs
Knowledge Extraction
Import or Export Knowledge Graph
Prepare Data for Import
Importing Knowledge Graph
Exporting Knowledge Graph
Auto-Generate Knowledge Graph
Knowledge Graph Analysis
Answer from Documents
Alert Tasks
Small Talk
Digital Skills
Overview
Digital Forms
Digital Views
Introduction
Widgets
Panels
Session and Context Variables
Context Object
Intent Discovery
Train
NLP Optimization
ML Engine
Overview
Model Validation
FM Engine
KG Engine
Traits Engine
Ranking and Resolver
Training Validations
NLP Configurations
NLP Guidelines
LLM and Generative AI
Introduction
LLM Integration
Kore.ai XO GPT Module
Prompts & Requests Library
Co-Pilot Features
Dynamic Conversations Features
Intelligence
Introduction
Event Handlers
Contextual Memory
Contextual Intents
Interruption Management
Multi-intent Detection
Amending Entities
Default Conversations
Conversation Driven Dialog Builder
Sentinment Management
Tone Analysis
Default Standard Responses
Ignore Words & Field Memory
Test & Debug
Overview
Talk to Bot
Utterance Testing
Batch Testing
Conversation Testing
Conversation Testing Overview
Create a Test Suite
Test Editor
Test Case Assertion
Test Case Execution Summary
Glossary
Health and Monitoring
NLP Health
Flow Health
Integrations
Actions
Actions Overview
Asana
Configure
Templates
Azure OpenAI
Configure
Templates
BambooHR
Configure
Templates
Bitly
Configure
Templates
Confluence
Configure
Templates
DHL
Configure
Templates
Freshdesk
Configure
Templates
Freshservice
Configure
Templates
Google Maps
Configure
Templates
Here
Configure
Templates
HubSpot
Configure
Templates
JIRA
Configure
Templates
Microsoft Graph
Configure
Templates
Open AI
Configure
Templates
Salesforce
Configure
Templates
ServiceNow
Configure
Templates
Stripe
Configure
Templates
Shopify
Configure
Templates
Twilio
Configure
Templates
Zendesk
Configure
Templates
Agents
Agent Transfer Overview
Custom (BotKit)
Drift
Genesys
Intercom
NiceInContact
NiceInContact(User Hub)
Salesforce
ServiceNow
Configure Tokyo and Lower versions
Configure Utah and Higher versions
Unblu
External NLU Adapters
Overview
Dialogflow Engine
Test and Debug
Deploy
Channels
Publishing
Versioning
Analyze
Introduction
Dashboard Filters
Overview Dashboard
Conversations Dashboard
Users Dashboard
Performance Dashboard
Custom Dashboards
Introduction
Custom Meta Tags
Create Custom Dashboard
Create Custom Dashboard Filters
LLM and Generative AI Logs
NLP Insights
Task Execution Logs
Conversations History
Conversation Flows
Conversation Insights
Feedback Analytics
Usage Metrics
Containment Metrics
Universal Bots
Introduction
Universal Bot Definition
Universal Bot Creation
Training a Universal Bot
Universal Bot Customizations
Enabling Languages
Store
Manage Assistant
Team Collaboration
Plan & Usage
Overview
Usage Plans
Templates
Support Plans
Invoices
Authorization
Conversation Sessions
Multilingual Virtual Assistants
Get Started
Supported Components & Features
Manage Languages
Manage Translation Services
Multiingual Virtual Assistant Behavior
Feedback Survey
Masking PII Details
Variables
Collections
IVR Settings
General Settings
Assistant Management
Manage Namespace
Data
Overview
Data Table
Table Views
App Definitions
Data as Service
HOW TOs
Build a Travel Planning Assistant
Travel Assistant Overview
Create a Travel Virtual Assistant
Design Conversation Skills
Create an ‘Update Booking’ Task
Create a Change Flight Task
Build a Knowledge Graph
Schedule a Smart Alert
Design Digital Skills
Configure Digital Forms
Configure Digital Views
Train the Assistant
Use Traits
Use Patterns
Manage Context Switching
Deploy the Assistant
Use Bot Functions
Use Content Variables
Use Global Variables
Use Web SDK
Build a Banking Assistant
Design Conversation Skills
Create a Sample Banking Assistant
Create a Transfer Funds Task
Create a Update Balance Task
Create a Knowledge Graph
Set Up a Smart Alert
Design Digital Skills
Configure Digital Forms
Configure Digital Views
Add Data to Data Tables
Update Data in Data Tables
Add Data from Digital Forms
Train the Assistant
Composite Entities
Use Traits
Use Patterns for Intents & Entities
Manage Context Switching
Deploy the Assistant
Configure an Agent Transfer
Use Assistant Functions
Use Content Variables
Use Global Variables
Intent Scoping using Group Node
Analyze the Assistant
Create a Custom Dashboard
Use Custom Meta Tags in Filters
Migrate External Bots
Google Dialogflow Bot
APIs & SDKs
API Reference
API Introduction
Rate Limits
API List
koreUtil Libraries
SDK Reference
SDK Introduction
Web SDK
How the Web SDK Works
SDK Security
SDK Registration
Web Socket Connect and RTM
Tutorials
Widget SDK Tutorial
Web SDK Tutorial
BotKit SDK
BotKit SDK Deployment Guide
Installing the BotKit SDK
Using the BotKit SDK
SDK Events
SDK Functions
Tutorials
BotKit - Blue Prism
BotKit - Flight Search Sample VA
BotKit - Agent Transfer
  1. Home
  2. Docs
  3. Virtual Assistants
  4. Bot Settings
  5. Bot Management
  6. Using Bot Variables

Using Bot Variables

Bot variables help you capture values that are commonly used by different tasks, nodes, and other bot elements. You can configure a bot variable as a key-value pair once in the bot settings and substitute key with value at runtime during the conversation flow. By capturing frequently used values in a single place, bot variables provide the advantages of reusability and consistency. For example, let’s say you are testing a flight booking bot using a staging endpoint. If you configure the endpoint as a variable, it helps you to call the API from several places quickly. When you want to change the staging endpoint to production while publishing the bot, it is easy. Similarly, variables can be used to externalize content for messages and prompts from the dialog flow definition. Kore.ai platform allows bot developers to define two types of variables – Environment and Content.

Environment Variables

Environment Variables are global, reusable components which can be used in multiple places to define the bot configuration. Every Environment Variable is a key-value pair. The Variable Keys can be used at various places in the bot configuration. The platform will resolve/replace the Variable Keys with Variables Values during the conversation. Some of the typical use cases where a developer can use environment variables are:

  • To manage the bot across environments having different endpoint URLs. The bot can be exported and imported based on the environment, and the infrastructure team will need to modify only the variable configuration file.
  • To manage Conditions in the Dialog Node Transitions. Only the left-hand side of the transition condition uses Environment Variables. The right-hand side of the transition conditions does not use Environment Variables
  • To define and manage the bot response that is repeated within the bot configuration as variables.
  • Authorization Token
  • Channel-related tokens and URLs

Post the release of v8.1 of the platform, for on-prem installations, multiple value sets can be stored for these environment variables using Collections, refer here for more.

Restricting Sensitive Data with Environment Variables

During the virtual assistant definition, developers may create environment variables for sensitive data like credentials/keys. These variables are useful for connecting to other systems using service nodes or as a part of authorization profiles. However, environment variables are visible to all the developers with shared access to the virtual assistant, especially when its definition is exported.

The latest Kore.ai XO Platform release introduces the Secure Variable feature for environment variables, which encrypts the added variable when enabled. This makes only the encrypted variable value visible to others and not the original value.

Important Considerations

  • The secure variable is encrypted in the database and does not require any encryption key.
  • The original value is used only internally for all service calls, language translation, etc. while executing the virtual assistant definition.
  • During the export of a secure variable through Bot or environment variables import, it has an empty value, so the original value is not available in plain text.

Leveraging Encrypted Environment Variable Values for Additional Modules

You can use the encrypted environment variable values in the following modules in addition to the other supported modules:

  • Channel Configuration: While configuring channels under Deploy > Channels, you can use encrypted/regular environment variable values for all the fields including access token, access key, app ID, URLs, etc.
  • Languages: Under Build > Configurations > Languages > Translation Configurations, while configuring the translation engine, you can use the regular/encrypted environment variable value (type {{env.environment variable name}}) to set up the encrypted variable name as the access key as follows:
    • The Access Key field for Google Translator or Microsoft Translator.
    • The Value field in the Configure Translation Engine panel for Custom Translation Engine Configurations.

    • Authorization Profiles – You can use encrypted/regular environment variables on the following fields while defining a new authorization mechanism for all types of authorizations:
      • Authorization Check URL, Field Key for form field, and Field Key and Field Value Authorization Fields for Authorization Type Basic Auth. Learn more.
      • Client Id, Client Secret Key, and Authorization URL for Authorization Type Oauth V2. Learn more.
      • Client Id, Client Secret Key, Token Request URL, Scope, and Refresh Token URL for Authorization Type Oauth V2 Client Credentials.
      • Consumer Key, Consumer Secret, Request Token Link, Access Token Link, and User Authorization Link for Authorization Type Oauth V1. Learn more.
      • Authorization Check URL and Field Key (for Form Field) for Authorization Type API Key. Learn more.
      • Field Key for Form Field, Token URL, Field Key, and Field Value for Authorization Field, and Refresh Token URL for Authorization Type Oauth V2 Password Grant Type. Learn more.

      The availability of the environment variables has been extended to the Field Key and Field Value parameters.

      Content Variables

      Bot building essentially requires extensive content management efforts. When it comes to multi-language bots, it also involves tedious coordination efforts between the developers and globally-distributed content authors or copyright team. Content variables enable you to overcome that by abstracting bot flow development efforts from authoring or editing the content. Using Content Variables, programmers can avoid hard-coding the bot content, such as prompts, messages, or any data presented to the user, into bot components, and instead point to specific variables in centrally managed Content Variables files for each bot language. You can export the language-specific content variable files to content editors, without exposing any bot configurations. The writers can author the content in the exported file, which you can import back into the bot.

Defining Bot Variables and Securing Them

Enabling the secure variable setting after defining an Environment (Bot) Variable, encrypts and securely stores credentials set as environment variables. To add a Bot variable, follow the steps below:

  1. Open the VA for which you want to add the variables.
  2. Navigate to Build > Configurations > Environment Variables on the left menu for Environment Variables or Content Variables to add Content Variables.
  3. In the Add Variable panel, provide the following details:
  • Variable Name: Enter the environment variable name. For example, user credentials.
  • Value: Enter the environment variable value that is encrypted.
  • Notes (optional): Any tip/note describing the environment variable.
  • Group (optional): The name of the group to which the environment variable is mapped.
  • Assign a Namespace if enabled (refer here for more).
  1. Enable the secure variable by switching to the Enabled state (Disabled is the default setting).
  2. Click Save.
  3. The environment variable and its encrypted value appear in the list.

Entering Language-Specific Values

To add language-specific values for content variables, you first need to switch the bot language. You can switch the language by clicking the name of the currently-enabled language from the top-right corner of the bot’s page and then selecting another language as follows:
 

After switching the language, go to Build > Configurations > Content Variables page and click the edit icon next to the relevant variable. Replace the text in the Value field in the enabled language.

Using Environment Variables

You can invoke an environment variable in plain text mode (Standard editor) using the following syntax: {{env.variableName}} If you are using it in JavaScript mode, it is env.variableName Here’s an example from a bot that uses two environment variables called botType and parameters to determine different bot environments such as development, testing, and production. The following script node in one of the bot’s tasks captures the base URL of the bot, depending on the current bot environment.

The URL in the following service node changes based on the captured URL

Updating the Environment Variable

For on-premise deployments, the user can update the encryption key/secured variable value with a new one. To edit the value, follow these steps:

  1. Click the Edit icon of the secure variable listing.
  2. In the Edit Environment Variable panel, click the Edit icon next to the Value textbox.
  3. Enter the new variable value to be encrypted and click Done.
  4. Click Save.

The new encrypted secure variable value is updated in the list as shown below:

Using Content Variables

You can invoke a content variable in plain text mode (Standard editor) using the following syntax. {{content.variableName}} If you are using it in JavaScript mode, it is content.variableName Here’s an entity node of a multi-language flight booking bot that captures the source airport of the users. It uses a content variable instead of a hard-coded user prompt.

When the bot reaches this node as a part of the user interaction, the user prompt changes depending on the language of the interaction (provided you entered the respective variable values for all the enabled languages).

Importing and Exporting

You can import and export bot variables between bots.

  1. On any of the Bot Variables page accessible from Build > Configurations -> (Environment/Content) Variables,
  2. Click the ellipses next to Add Variables
  3. To Import: Select Import to import variables from a JSON or CSV file
    • Since the import will replace the existing variables, you are advised to take a backup of the same.
    • After taking a Backup, Proceed with the Import
    • Select a JSON or CSV file to import (see below for the file format)
  4. To Export: From Export select the preferred format for the export file:
    • Bot variables are exported in the form of a JSON, CSV file based upon your selection.
    • This file includes both environment and content variables.

The Bot Variable file contains the following information, the same needs to be present in your Import file. CSV files need a header row. You are advised to refer to the Export (or backup) file and use the same format for the Import file.

  • key (mandatory) – name of the variable
  • scope  – the scope of the variable corresponds to the Setup Option at the time of variable declaration (if not provided will be set to prePopulated) and can be
    • prePopulated,
    • askOnInstall, or
    • hidden
  • value – the value of the variables
  • variableType (if not set will default to env)-
    • env for Environment and
    • locale for Content Variable
  • audioTag -for the player details in case IVR enabled
  • group – group name
  • hint – description of the variable
  • propagateVAlue – true or false
  • vNamespace – the namespace associated to the variable
  • Language-specific variable

Sample CSV file:

Sample JSON file:

[
  {"key":"hosturl",
   "value":"https://bots.kore.ai",
   "hint":"This is the URL of environment which can be used across the endpoints configured in the bot",
   "audioTag":"",
   "variableType":"env",
   "scope":"prePopulated",
   "group":"URLS"}
]

Using Bot Variables

Bot variables help you capture values that are commonly used by different tasks, nodes, and other bot elements. You can configure a bot variable as a key-value pair once in the bot settings and substitute key with value at runtime during the conversation flow. By capturing frequently used values in a single place, bot variables provide the advantages of reusability and consistency. For example, let’s say you are testing a flight booking bot using a staging endpoint. If you configure the endpoint as a variable, it helps you to call the API from several places quickly. When you want to change the staging endpoint to production while publishing the bot, it is easy. Similarly, variables can be used to externalize content for messages and prompts from the dialog flow definition. Kore.ai platform allows bot developers to define two types of variables – Environment and Content.

Environment Variables

Environment Variables are global, reusable components which can be used in multiple places to define the bot configuration. Every Environment Variable is a key-value pair. The Variable Keys can be used at various places in the bot configuration. The platform will resolve/replace the Variable Keys with Variables Values during the conversation. Some of the typical use cases where a developer can use environment variables are:

  • To manage the bot across environments having different endpoint URLs. The bot can be exported and imported based on the environment, and the infrastructure team will need to modify only the variable configuration file.
  • To manage Conditions in the Dialog Node Transitions. Only the left-hand side of the transition condition uses Environment Variables. The right-hand side of the transition conditions does not use Environment Variables
  • To define and manage the bot response that is repeated within the bot configuration as variables.
  • Authorization Token
  • Channel-related tokens and URLs

Post the release of v8.1 of the platform, for on-prem installations, multiple value sets can be stored for these environment variables using Collections, refer here for more.

Restricting Sensitive Data with Environment Variables

During the virtual assistant definition, developers may create environment variables for sensitive data like credentials/keys. These variables are useful for connecting to other systems using service nodes or as a part of authorization profiles. However, environment variables are visible to all the developers with shared access to the virtual assistant, especially when its definition is exported.

The latest Kore.ai XO Platform release introduces the Secure Variable feature for environment variables, which encrypts the added variable when enabled. This makes only the encrypted variable value visible to others and not the original value.

Important Considerations

  • The secure variable is encrypted in the database and does not require any encryption key.
  • The original value is used only internally for all service calls, language translation, etc. while executing the virtual assistant definition.
  • During the export of a secure variable through Bot or environment variables import, it has an empty value, so the original value is not available in plain text.

Leveraging Encrypted Environment Variable Values for Additional Modules

You can use the encrypted environment variable values in the following modules in addition to the other supported modules:

  • Channel Configuration: While configuring channels under Deploy > Channels, you can use encrypted/regular environment variable values for all the fields including access token, access key, app ID, URLs, etc.
  • Languages: Under Build > Configurations > Languages > Translation Configurations, while configuring the translation engine, you can use the regular/encrypted environment variable value (type {{env.environment variable name}}) to set up the encrypted variable name as the access key as follows:
    • The Access Key field for Google Translator or Microsoft Translator.
    • The Value field in the Configure Translation Engine panel for Custom Translation Engine Configurations.

    • Authorization Profiles – You can use encrypted/regular environment variables on the following fields while defining a new authorization mechanism for all types of authorizations:
      • Authorization Check URL, Field Key for form field, and Field Key and Field Value Authorization Fields for Authorization Type Basic Auth. Learn more.
      • Client Id, Client Secret Key, and Authorization URL for Authorization Type Oauth V2. Learn more.
      • Client Id, Client Secret Key, Token Request URL, Scope, and Refresh Token URL for Authorization Type Oauth V2 Client Credentials.
      • Consumer Key, Consumer Secret, Request Token Link, Access Token Link, and User Authorization Link for Authorization Type Oauth V1. Learn more.
      • Authorization Check URL and Field Key (for Form Field) for Authorization Type API Key. Learn more.
      • Field Key for Form Field, Token URL, Field Key, and Field Value for Authorization Field, and Refresh Token URL for Authorization Type Oauth V2 Password Grant Type. Learn more.

      The availability of the environment variables has been extended to the Field Key and Field Value parameters.

      Content Variables

      Bot building essentially requires extensive content management efforts. When it comes to multi-language bots, it also involves tedious coordination efforts between the developers and globally-distributed content authors or copyright team. Content variables enable you to overcome that by abstracting bot flow development efforts from authoring or editing the content. Using Content Variables, programmers can avoid hard-coding the bot content, such as prompts, messages, or any data presented to the user, into bot components, and instead point to specific variables in centrally managed Content Variables files for each bot language. You can export the language-specific content variable files to content editors, without exposing any bot configurations. The writers can author the content in the exported file, which you can import back into the bot.

Defining Bot Variables and Securing Them

Enabling the secure variable setting after defining an Environment (Bot) Variable, encrypts and securely stores credentials set as environment variables. To add a Bot variable, follow the steps below:

  1. Open the VA for which you want to add the variables.
  2. Navigate to Build > Configurations > Environment Variables on the left menu for Environment Variables or Content Variables to add Content Variables.
  3. In the Add Variable panel, provide the following details:
  • Variable Name: Enter the environment variable name. For example, user credentials.
  • Value: Enter the environment variable value that is encrypted.
  • Notes (optional): Any tip/note describing the environment variable.
  • Group (optional): The name of the group to which the environment variable is mapped.
  • Assign a Namespace if enabled (refer here for more).
  1. Enable the secure variable by switching to the Enabled state (Disabled is the default setting).
  2. Click Save.
  3. The environment variable and its encrypted value appear in the list.

Entering Language-Specific Values

To add language-specific values for content variables, you first need to switch the bot language. You can switch the language by clicking the name of the currently-enabled language from the top-right corner of the bot’s page and then selecting another language as follows:
 

After switching the language, go to Build > Configurations > Content Variables page and click the edit icon next to the relevant variable. Replace the text in the Value field in the enabled language.

Using Environment Variables

You can invoke an environment variable in plain text mode (Standard editor) using the following syntax: {{env.variableName}} If you are using it in JavaScript mode, it is env.variableName Here’s an example from a bot that uses two environment variables called botType and parameters to determine different bot environments such as development, testing, and production. The following script node in one of the bot’s tasks captures the base URL of the bot, depending on the current bot environment.

The URL in the following service node changes based on the captured URL

Updating the Environment Variable

For on-premise deployments, the user can update the encryption key/secured variable value with a new one. To edit the value, follow these steps:

  1. Click the Edit icon of the secure variable listing.
  2. In the Edit Environment Variable panel, click the Edit icon next to the Value textbox.
  3. Enter the new variable value to be encrypted and click Done.
  4. Click Save.

The new encrypted secure variable value is updated in the list as shown below:

Using Content Variables

You can invoke a content variable in plain text mode (Standard editor) using the following syntax. {{content.variableName}} If you are using it in JavaScript mode, it is content.variableName Here’s an entity node of a multi-language flight booking bot that captures the source airport of the users. It uses a content variable instead of a hard-coded user prompt.

When the bot reaches this node as a part of the user interaction, the user prompt changes depending on the language of the interaction (provided you entered the respective variable values for all the enabled languages).

Importing and Exporting

You can import and export bot variables between bots.

  1. On any of the Bot Variables page accessible from Build > Configurations -> (Environment/Content) Variables,
  2. Click the ellipses next to Add Variables
  3. To Import: Select Import to import variables from a JSON or CSV file
    • Since the import will replace the existing variables, you are advised to take a backup of the same.
    • After taking a Backup, Proceed with the Import
    • Select a JSON or CSV file to import (see below for the file format)
  4. To Export: From Export select the preferred format for the export file:
    • Bot variables are exported in the form of a JSON, CSV file based upon your selection.
    • This file includes both environment and content variables.

The Bot Variable file contains the following information, the same needs to be present in your Import file. CSV files need a header row. You are advised to refer to the Export (or backup) file and use the same format for the Import file.

  • key (mandatory) – name of the variable
  • scope  – the scope of the variable corresponds to the Setup Option at the time of variable declaration (if not provided will be set to prePopulated) and can be
    • prePopulated,
    • askOnInstall, or
    • hidden
  • value – the value of the variables
  • variableType (if not set will default to env)-
    • env for Environment and
    • locale for Content Variable
  • audioTag -for the player details in case IVR enabled
  • group – group name
  • hint – description of the variable
  • propagateVAlue – true or false
  • vNamespace – the namespace associated to the variable
  • Language-specific variable

Sample CSV file:

Sample JSON file:

[
  {"key":"hosturl",
   "value":"https://bots.kore.ai",
   "hint":"This is the URL of environment which can be used across the endpoints configured in the bot",
   "audioTag":"",
   "variableType":"env",
   "scope":"prePopulated",
   "group":"URLS"}
]
Menu