https://retellai.com/?utm_source=discord&utm_medium=seo logo
how do i ensure that my ai agent understans the cu...
# ❓・ai-evy-support
a
@AI Evy how do i ensure that my ai agent understans the current date and is able to understand what date the next week is
a
Thanks for tagging me @arina_06888. I'll look through relevant sources and get back to you shortly.
### Answer To ensure your AI agent understands the current date and can calculate future dates like "next week," you should use Retell AI's built-in dynamic variables system [(1) ]() . Use Default System Variables for Current Date: Retell AI provides several default system variables that automatically inject current date and time information : -
{{current_time}}
- Provides the current date and time -
{{current_calendar}}
- Provides a 14-day calendar in America/Los_Angeles timezone -
{{current_calendar_[timezone]}}
- Provides a 14-day calendar in a specified timezone Implementation Steps: 1. Add the current time variable to your agent's prompt :
Copy code
"Current time is {{current_time}}"
2. Use the calendar variable for date calculations :
Copy code
"Today's date and upcoming dates: {{current_calendar}}"
Troubleshooting Date Issues: If you're experiencing issues with incorrect day-of-week calculations, there are a few solutions based on community feedback [(2) ]() : - Ensure you include the current time variable in your prompt - Consider upgrading to GPT-4o instead of GPT-4o mini if you're experiencing date accuracy issues - Make sure to specify the current year in your prompt Dynamic Variables Usage: You can use these variables in various parts of your agent configuration including prompts, begin messages, and tool descriptions [(1) ]() . All dynamic variable values must be strings . This approach ensures your agent has accurate, real-time date information and can properly calculate relative dates like "next week."
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Agent giving incorrect day of week when telling patients their visit dates](https://discord.com/channels/1186424376300679209/1296650281463058432) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.