Abstract
Memory enables Large Language Model (LLM) agents to perceive, store, and use information from past dialogues, which is essential for personalization. However, existing methods fail to properly model the temporal dimension of memory in two aspects: 1) Temporal inaccuracy: memories are organized by dialogue time rather than their actual occurrence time; 2) Temporal fragmentation: existing methods focus on point-wise memory, losing durative information that captures persistent states and evolving patterns. To address these limitations, we propose Temporal Semantic Memory (TSM), a memory framework that models semantic time for point-wise memory and supports the construction and utilization of durative memory. During memory construction, it first builds a semantic timeline rather than a dialogue one. Then, it consolidates temporally continuous and semantically related information into a durative memory. During memory utilization, it incorporates the query's temporal intent on the semantic timeline, enabling the retrieval of temporally appropriate durative memories and providing time-valid, duration-consistent context to support response generation. Experiments on LongMemEval and LoCoMo show that TSM consistently outperforms existing methods and achieves up to 12.2% absolute improvement in accuracy, demonstrating the effectiveness of the proposed method.
Introduction: The Temporal Gap in LLM Memory
For an LLM agent to feel truly personalized, it needs a robust long-term memory. Typically, developers implement this by chunking past dialogue and storing it in a vector database. However, existing systems suffer from two major temporal flaws:
- Temporal Inaccuracy: Most systems organize memory by dialogue time (when the chat occurred). If a user tells an agent today about a trip taken last month, the system timestamps that memory as "today." Consequently, when the user later asks about "last month's trip," the agent fails to retrieve the relevant context.
- Temporal Fragmentation: Memories are often stored as isolated, point-wise entries. If a user discusses planning a trip across multiple sessions, the agent treats these as disconnected facts, losing the "durative" information—the ongoing state, evolving plans, or persistent user personas.
Methodology: Temporal Semantic Memory (TSM)
To address these issues, we propose Temporal Semantic Memory (TSM), which decouples dialogue time from semantic time using a two-tier architecture involving memory construction and utilization.
Memory Construction
TSM builds a semantic timeline by extracting entities and relations from chat turns into a Temporal Knowledge Graph (TKG). Crucially, it grounds these facts in semantic time (e.g., explicitly tagging a node with the actual dates of an event mentioned in text).
Furthermore, TSM creates Durative Memory by chunking the timeline into slices (e.g., months). It uses Gaussian Mixture Models (GMM) to cluster related entities within a slice and employs an LLM to summarize them into higher-level "Topics" and "Personas."
Memory Utilization
When a user issues a query, TSM parses the temporal intent (e.g., "last weekend") using natural language processing tools. It performs dense retrieval and then strictly filters and reranks results based on whether the memory's semantic timestamp aligns with the query's intent. This ensures the agent provides time-valid and duration-consistent context.
Experimental Evaluation
TSM was evaluated on two public long-term memory benchmarks: LongMemEval (specifically LongMemEval_S), which tests chat assistants on ~115k token histories, and LoCoMo, which focuses on extremely long multi-session dialogues averaging 300 turns.
Key Results
TSM was compared against several baselines, including standard RAG, LangMem, MemoryOS, and graph-based systems like Mem0 and Zep.
- Performance Gains: On LongMemEval_S using GPT-4o-mini, TSM achieved 74.80% overall accuracy, representing a +12.2% absolute improvement over the next best baseline (A-MEM).
- Reasoning Strengths: The most significant improvements were observed in Temporal reasoning (+22.56%) and Multi-Session reasoning (+20.30%).
- LoCoMo Results: TSM also achieved the best performance among memory-based methods on the LoCoMo dataset with 76.69% accuracy.
- Ablation Study: Removing the temporal reranking step caused the largest performance drop, confirming that explicitly filtering by semantic time is critical for accuracy.
Conclusion and Future Work
TSM demonstrates that indexing memories by real-world semantic time rather than dialogue time is essential for reliable agent recall. By clustering point-wise facts into "Topics" and "Personas," agents can maintain a coherent understanding of evolving user states. Future work will explore adaptive temporal granularity to handle varying event densities and extend the framework to procedural and shared memory environments.
Summary updated