Variables

Tahsim Ahmed
Tahsim Ahmed
  • Updated

Introduction to the Variables Page

The Variables CMS is an integral component of the agent creation experience that lets you define and organize the variables used throughout your AI agent's interactions. Variables are essential for capturing and utilizing data dynamically during conversations with users.

 

Variables Table Overview

  • Name: The identifier for the variable. It's how you'll reference the variable within your workflows and scripts.
  • Description: Provides context for the variable, explaining what data it stores and how it's used within the application.
  • Default Value: The initial value a variable will hold before any user interaction or data manipulation. This is a new feature that enhances your agent's ability to manage data more efficiently.
  • Last Editor: Indicates who last modified the variable, which is crucial for collaborative projects.
  • Updated: The timestamp of when the variable was last updated, helping you track changes over time.

Create a variable

  1. Creating Variables:
    1. From Agent CMS: Select the 'New variable' option to begin defining a new variable.
    2. From Canvas:
      1. In any AI, API or Talk step, start typing in the input field with the left (curly) brace '{' and select +
      2. In the Condition step, in any of the If (Add a condition) fields start typing and select Create
      3. In the Function step, in any of the input or output variable sections, start typing with the left curly brace '{' and select Create variable
  2. Setting Variable Details:
    1. Naming the Variable: Assign a name that succinctly conveys its function, like userAge for holding a user's age or orderStatus for tracking an order's processing state.
    2. Describing the Variable: Write a concise description that clarifies the variable's role, such as "Holds the user's age for eligibility verification."
    3. Setting a Default Value: If applicable, specify a default value that the variable should assume before any interaction or computation, like setting a numeric variable for 'orderCount' to 0.

Edit existing variables

  1. Access Variables:
    1. From Agent CMS: In the Variables table, select any variable you wish to edit from the displayed list.
    2. From Canvas: In any AI or Talk step which is using a variable, select the variable chip to display the edit variable modal
  2. Editing Variable Details:
    • Change the Name: Update the variable's name to better reflect its current use or for greater clarity.
    • Revise the Description: Enhance the variable's description to keep up with changes in its usage or to add more detail for collaborative purposes.
    • Adjust the Default Value: Modify the default value as required based on new logic requirements or understanding of user interactions.
      • Note: Updates to the Default Value do not take affect until a new version of the project is published (for the Production environment), or until (for the Development environment)
  • Organizing Variables (on Agent CMS): Utilize the sorting functionality within the CMS to order your variables list either by name or by the date they were created.

Deleting variables

  1. Single Variable:
    1. To delete a single variable, select the variable you wish to remove, and in the editor view click the '...' (more options) button, and select 'Delete' from the dropdown menu.
    2. Confirm the deletion when prompted to remove the variable from your CMS.
  2. Bulk Deleting Variables:
    1. For bulk actions, select multiple variables by selecting the checkboxes next to the variable names.
    2. Once selected, on the bulk action toolbar above the table, click the 'Delete' button to initiate the bulk deletion process.
    3. Confirm the bulk deletion to remove all selected variables simultaneously.

Usage

Variables can be used within the following steps:

Best practises for variable management

  • Use descriptive names: Choose variable names that clearly reflect the data they hold, such as "userEmail" or "orderTotal".
  • Document purposefully: Write clear descriptions that explain the variable's role within your AI agent's workflow.
  • Set thoughtful default values: Default values should make sense for the expected data type and anticipated user interaction.
  • Test default values: Ensure that the default values you set for variables behave as expected during user interactions.
  • Maintain consistency: Use a consistent naming convention for your variables to make them easily identifiable and manageable.
  • Regularly review and refine: As your AI agent evolves, revisit your variables to see if they still serve their intended purpose or need adjustments.

Was this article helpful?

3 out of 3 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.