Looking at your code, the LLM is not being provided with today’s date, which could definitely cause issues with understanding what constitutes “past talks.”
Here’s the problem: Your getPastTalks()
function correctly uses today’s date to filter past talks from the database, but when you call the LLM in hasTopicBeenCovered()
and findRelatedTalks()
, you’re only sending the topics/talk data without any temporal context.
The LLM has no way of knowing:
- What today’s date is
- How to interpret the dates in your talk data
- What “past” even means in your context
Here’s how you could fix this by providing date context to the LLM:
Key changes made:
- Added today’s date to system messages - The LLM now knows what “today” means
- Included dates with topics - In
hasTopicBeenCovered()
, topics now show their dates like “React Hooks (2024-01-15)” - Clearer context - System messages explicitly explain that these are talks from before today
- Consistent date formatting - Using ISO date format (YYYY-MM-DD) for clarity
This should resolve the issue where the LLM might not understand temporal context when determining what constitutes “past talks” versus current or future ones.