Skip to main content
Variables are internal data holders used by AI Pilots to temporarily store and manipulate information during a conversation. Unlike entities, which capture data directly from the user (e.g., name, email, or query), variables are updated internally using flows, actions, or API calls. They play a critical role in AI Pilots by allowing you to store, manage, and utilize dynamic data during conversations. Whether you’re fetching data from an API, calculating values, or referencing previous user inputs, variables make it possible.

Topics covered:

Components of a Variable

Each variable includes the following attributes
  • Name: The name number must be unique across all AI Pilots, and it allows alphanumeric values and underscores.
  • Variable Name: This name will be visible in the execution flows.
  • Description (Optional): Provide a brief explanation of the variable’s function for reference.
  • Type: You can choose a type from the drop-down menu. It will have the following types:
    • Text: Stores strings (e.g., names, emails)
    • Number: Stores numeric values (e.g., price, quantity)
    • Date: Stores date values
    • DateTime: Stores both date and time
  • Default Value (Optional): You can provide a default value for the variable.
Note: Variables in AI Pilots are global and distinct from Smart Flow’s local variables.

System Default Variables

These pre-defined variables are available in every AI Pilot and cannot be edited or deleted
Variable NameDescriptionExample
last_responseStores the last AI replyWhere would you like to travel?
last_utteranceCaptures the user’s last messageReset my password
localeCaptures the user’s language/regionen-US, fr-FR
conversation_user_idUnique user identifierabc123xyz456
conversation_historyStores the last 10 user-AI messagesAI Pilot: How can I help?” user: What’s the weather today?” AI Pilot: The weather is sunny and 25°C.

Create a Variable

To create a new Variable, you will need to follow the steps below:
  • Navigate to AI Pilots from left panel.
mceclip0.png
  • Select the correct AI Pilot.
  • Click on Variables.
  • Click on New.
mceclip1.png
  • Fill in the fields like Name, Description, Type, and Default Value.
mceclip3.png
  • Click Save.
Note: An entity name and a variable name cannot be the same.These variables will be accessible only in the flows, intents, & prompts created within the AI Pilot.

View Variables

To view the variables for an AI Pilot, please follow the steps below:
  • Navigate to AI Pilot under More.
  • Select the correct AI Pilot.
  • Click on Variables.
  • The variable list will show:Name, Variable Name, Description (shown on hover), Default Value, Last Modified By / Date
  • You can sort the variables based on Name and Last Modified Date.
  • You can search the variable by name or variable name (internal name).
mceclip6.png

Edit a Variable

To edit a variable, please follow the steps below:
  • Navigate to AI Pilot under More.
  • Select the correct AI Pilot.
  • Click on Variables.
  • Click on the Variable name from the list.
  • You can update: Name, Description, and Default Value.
  • Click Save.
mceclip5.png

Delete a Variable

To delete a variable, please follow the steps below:
  • Navigate to AI Pilot under More.
  • Select the correct AI Pilot.
  • Click on Variables.
  • Hover over on the Variable name.
  • Click on Actions.
  • Click on Delete.
mceclip7.png
  • A confirmation window will pop up.
mceclip6(1).png
  • Click on Yes.
Note: If the variable is used anywhere, then it will give you the error message and block you from deleting it.

Practical Use Case

You can use Variables to store the delivery address provided by the customer within the chat conversation. Here are the steps on how you can do that.
  1. Create a Variable named Delivery Address.
    • Name: Delivery Address
    • Variable Name: deliveryaddress
    • Description: Stores the address where the user wants the order delivered
    • Type: Text
  2. Give a prompt to the user for the Delivery address.
  3. Store the response of the user in a Variable.
  4. Use the variable in the confirmation message as a reply.