[Discussion] Temporal memory coherence in long-running agent sessions

#26
by Spy9191 - opened

A pattern that keeps surfacing when building agents that run over multiple sessions:

Vector retrieval does not know about time. When a fact changes โ€” user preference, project state, a tool's API โ€” both the old and new fact exist in the vector store. Similarity search retrieves both with equal confidence.

The result is agents that confidently state outdated information. Not hallucination in the traditional sense โ€” the fact was true, it just isn't anymore.

The fix we found most robust: treat memory entries as temporal intervals rather than documents. Each fact carries a valid_from and valid_to. When a new fact supersedes an old one, the old record is closed (valid_to is set) and the new one is opened. Active memory is WHERE valid_to IS NULL.

This gives agent memory the property of being correct at a point in time, not just semantically similar. Querying "what does the agent know right now" becomes a deterministic index scan, not a probabilistic retrieval.

Has anyone implemented something similar in their agent frameworks here? Curious whether smolagents or other HF-ecosystem tools have considered this at the storage layer.

Sign up or log in to comment