Agent thinks it's in the past?
I'm testing a medical symptom tracking bot and when somebody today told it that their symptoms started in January 2025 , my agent replied:
"I understand your main problem started in January 2025 (I notice this is a future date, so I assume you meant January 2023 or 2024)"
I don't see where the agent might think it's in the past, I checked my computer settings but maybe it's an issue with the user's local device?
4 Replies
It isn’t a device or Voiceflow runtime issue – the LLM simply doesn’t know today’s date unless you tell it.
• When Voiceflow calls the model it sends only the text you put in your Prompt / System Prompt. The model’s internal “current date” is still the one it was trained with (early-2023 for GPT-4/Turbo), so anything after that can be interpreted as the future.
• Because you didn’t include today’s date in the prompt, the model assumed Jan 2025 was ahead of “now” and produced the clarification you saw.
How to give the model the right date
------------------------------------
1. Create a variable that holds today’s date. The quickest way is a Code or Function step right before your Prompt step:
(If you prefer a UNIX value, the built-in timestamp system variable is also available – see variable examples in the docs.)
2. Reference that variable in your system prompt, e.g.:
3. Publish / run – the model will now judge January 2025 as past (because it has the real current date in context).
This change is workflow-specific, so add the same line to any other prompts that rely on knowing what “today” is.
Docs for reference: Variables & timestamp example – https://docs.voiceflow.com/docs/variables-set
@David140 I also have experienced that behaviour. My solution was a function which I created and give it to the "Agent"-step as tool. That works as well.
This could be fine because within the function you could also solve that "problem" when a user says his symptoms started 5 days ago. Sometimes the agent can not handle relative timestamps very well.
Aha! Thanks @ScaBasX and @Tico | Voiceflow Assistant I added that now using this in a JS script and it seems like it works 🙂
const now = new Date();
date_today = now.toLocaleDateString('en-IE',{ year:'numeric', month:'long', day:'numeric'});
Awesome, sounds and looks good! 🙂