Summary
Add the current date as a template variable to both the query rewrite and chat answer prompts. This will help the LLM understand temporal context when answering questions like "What happened last week?" or "What are the current policies?"
Proposed Changes
- Pass
current_date (formatted as "February 3, 2026") to the query rewrite prompt (query_rewrite.system.jinja2)
- Pass
current_date to the chat answer prompt (chat_answer.system.jinja2)
- Update the Jinja2 templates to include the date in the system message
Implementation Notes
- Use
datetime.now().strftime("%B %d, %Y") for formatting
- Add
current_date to system_template_variables in both chatreadretrieveread.py call sites
- Consider if the date should also be added to the agentic retrieval path in
approach.py
Related
This was partially implemented but reverted from the Jinja2 migration PR to keep that change focused.
Summary
Add the current date as a template variable to both the query rewrite and chat answer prompts. This will help the LLM understand temporal context when answering questions like "What happened last week?" or "What are the current policies?"
Proposed Changes
current_date(formatted as "February 3, 2026") to the query rewrite prompt (query_rewrite.system.jinja2)current_dateto the chat answer prompt (chat_answer.system.jinja2)Implementation Notes
datetime.now().strftime("%B %d, %Y")for formattingcurrent_datetosystem_template_variablesin bothchatreadretrieveread.pycall sitesapproach.pyRelated
This was partially implemented but reverted from the Jinja2 migration PR to keep that change focused.