How Variables Work
Variables let you personalize your agent’s prompt with dynamic data. itellicoAI uses Jinja2 for templating — see the official docs for the full language reference.Variable Sources
Built-in Contact Variables
If a contact exists in your itellicoAI account, these 5 fields are automatically available:Everything Else: Dynamic Context API
All other data must come from your Dynamic Context connection (set up by your development team) as variables you can use directly. See Dynamic Context API. You can return any fields you want. For example:Available Variables
Built-in Contact Variables
These variables are automatically available from your itellicoAI contacts:Custom fields are NOT nested under
contact. — they’re variables you can use directly like {{ language }} or {{ account_tier }}. You must provide these through your Dynamic Context connection (set up by your development team). See Dynamic Context API.Dynamic Context Variables
Any custom data you provide through your Dynamic Context connection (set up by your development team) becomes available as variables you can use directly:Date & Time
The current datetime is automatically available ascurrent_datetime in both greetings and prompts:
Use the
datetime filter for formatting. Direct date formatting methods are not available. Use the datetime filter shown above instead.Conditional Logic
If Statement
If-Else
If-Elif-Else
Real-World Example
Filters
Filters transform variable values.Common Filters
default: Provide fallback valueChaining Filters
Loops
Iterate over lists (advanced use case):Practical Examples
Example 1: Personalized Greeting
Example 2: Custom Business Logic (Requires Dynamic Context API)
Variables like
company_name and account_tier must be provided by your Dynamic Context connection (set up by your development team). See Dynamic Context API.Example 3: Time-Based Prompt Logic
Example 4: Multi-Language Support (Requires Dynamic Context API)
Example 5: Account Tier Logic
Testing Variables
Test with Different Data
- Open the agent’s Test Agent menu and choose Chat, Web call, or Phone call
- Test scenarios with different contact data:
- With first name vs without
- VIP vs standard customer
- Different languages
- Different timezone
Common Issues
Best Practices
Always Use Defaults
Always Use Defaults
Never assume a variable has a value. Always provide defaults.❌ Bad:✅ Good:
Keep Logic Simple
Keep Logic Simple
Complex nested conditions are hard to debug. Keep it simple.❌ Too complex:✅ Simpler:
Test Edge Cases
Test Edge Cases
Test with:
- Missing data (all fields empty)
- Unexpected values
- Very long strings
- Special characters
Next Steps
Prompt Engineering Guide
See variables in action with complete examples
Test Your Agent
Test your variables work correctly