Variables are essential for creating dynamic, personalized, and context-aware experiences. They allow your AI Agent to collect information from end users, track conversation state, and pass data into elements like Actions and Playbooks. This topic outlines best practices for designing, storing, and reusing Variables effectively, along with common pitfalls and examples of good variable usage.
Choose names that describe what the variable stores, rather than generic labels. Clear naming helps both the AI Agent and future builders understand the variable’s purpose.
Good examples
user_emailshipping_addressaccount_tierAvoid
valueinput1tempAutocapture Variables perform best when the information is something the end user will naturally state during the conversation (such as email, phone number, or order number).
Use Autocapture when:
Avoid Autocapture when:
Global Variables persist and can be reused across Actions, Playbooks, Processes, and other elements.
They are ideal for:
Avoid storing:
Sensitive variables should be used for personally identifiable or sensitive data.
Sensitive variables:
Metavariables give your AI Agent information about the end user’s device, browser, channel, and system state.
Common use cases:
Metavariables cannot be created manually. They are populated automatically or passed via setMetaFields() in your embed script.
Variables can store up to 100,000 characters, but smaller values are better for performance and maintainability.
Best practices:
Before using a Capture block, check whether the value already exists.
Use Set Variable or Conditional block to:
Avoid asking end users to repeat information that your system already knows. Use setMetaFields() to pass things like:
This ensures consistency and reduces effort for authenticated end users.
Variable persistence depends on how Ada recognizes end users. Test with:
Variable sets can grow over time! Keep them clean by:
Here are some common errors that can impact performance or end user experience.
Variables that store entire API responses or large JSON objects may exceed the character limit or become difficult to work with.
Autocapture may misinterpret ambiguous inputs or fail in non-English languages.
Sensitive details should be stored only in Sensitive variables.
Variable reuse depends on identity, channel rules, and persistence settings. A new end user session may clear Global variable values.
Correct
Avoid
Store only the fields you actually intend to use.
Correct
Avoid Asking the end user: “What is your email address?” for authenticated sessions.
Correct
If user_email exists, no need to capture it in a variable.
Avoid Asking the end user for their email every time the process runs.