TL;DR
MemWeaver is a novel tri-layer hybrid memory framework that equips LLM agents with the ability to maintain temporal consistency and perform complex multi-hop reasoning over long-horizon interactions. By weaving together structured knowledge graphs, abstract experience patterns, and raw text evidence, it improves reasoning accuracy while slashing input context lengths by over 95% compared to long-context baselines.
What Problem Does This Paper Address?
As LLM agents transition from single-turn chatbots to long-term assistants spanning multiple sessions, managing memory becomes a critical bottleneck. Existing memory architectures typically fall into three traps:
- Flat retrieval (Vector RAG): Storing raw interaction traces lacks relational and temporal structure, making it brittle for time-constrained or multi-hop queries.
- Pure Structured Memory (Knowledge Graphs): While great for compositional reasoning, KGs often suffer from noisy extractions and lack session-level verification.
- High-Level Abstractions: Summarizing past behaviors or preferences strips away the raw context, hindering traceability and error correction.
Furthermore, most systems treat memory as a passive buffer rather than an active, evolving consolidation process. This leads to temporal conflicts (e.g., confusing an event from 2021 with one from 2024) and bloated context windows.
Methods
The authors introduce MemWeaver, a consolidation-centric framework that organizes long-term agent experiences into three tightly linked layers:
- Graph Memory (GM): A structural backbone that captures entities and relations. Crucially, it normalizes implicit temporal expressions (like "yesterday") into absolute timestamps to resolve temporal conflicts.
- Experience Memory (ExpM): This layer abstracts recurring interaction patterns (e.g., user preferences or behavioral tendencies) across sessions using DBSCAN clustering and LLM-based distillation.
- Passage Memory (PM): Preserves the raw, verbatim textual traces. Crucially, these passages are anchored directly to entity nodes in the Graph Memory, ensuring full traceability back to original evidence.
During inference, MemWeaver uses a Dual-Channel Memory Retrieval strategy. Channel 1 executes structured retrieval over the knowledge graph to fetch precise relational facts. Channel 2 performs textual retrieval to gather the exact supporting passages and experience items linked to those graph nodes, alongside a global dense retrieval pass for maximum recall.
Datasets
The framework was evaluated on the LoCoMo benchmark, which is specifically designed for long-term conversational QA. Unlike standard datasets that feature short histories, LoCoMo contains extended multi-session dialogue histories averaging around 9,000 tokens and spanning up to 35 sessions. The evaluation focuses on four answerable question categories: Single-Hop, Multi-Hop, Temporal, and Open-Domain, as well as an Adversarial task to test robustness against unanswerable queries.
Key Insights and Ideas
- Time Normalization is Non-Negotiable: Simply building a knowledge graph isn't enough for long-horizon agents. Explicitly mapping relative time cues to absolute dates allows the agent to accurately reason over the chronological order of events across disjointed sessions.
- Memory as an Active Consolidation Process: Instead of dumping every turn into a vector database, MemWeaver actively reviews and updates its memory offline (using a session-level review step), removing redundant relations and updating existing ones.
- Precision Over Volume: Hyperparameter analysis reveals that MemWeaver's performance is remarkably stable across varying retrieval budgets. It doesn't rely on brute-force context expansion; its structured design ensures that a small, highly relevant set of contexts is sufficient for accurate generation.
Key Results
MemWeaver was tested across four backbone LLMs (GPT-4o-mini, Llama3.2-3B/1B, and Qwen2.5-1.5B) and consistently outperformed strong baselines like MemoryBank and A-Mem:
- Massive Context Reduction: While standard long-context prompting requires over 22,000 tokens per query on LoCoMo, MemWeaver operates within less than 1,000 tokens—a context reduction of over 95%.
- Superior Temporal & Multi-Hop Reasoning: On GPT-4o-mini, MemWeaver boosted Temporal reasoning F1 scores from 22.54 (LoCoMo baseline) and 38.77 (A-Mem) to 50.83.
- Adversarial Robustness: On the adversarial task, MemWeaver achieved over a 10% gain in Exact Match (EM) and massive improvements across F1 and ROUGE metrics, proving highly resilient to misleading or conflicting memory signals.
Limitations and Future Work
The authors note two primary limitations:
- Dependency on Construction Backbones: The quality of the tri-layer memory relies heavily on the capabilities of the LLM used for offline memory construction (DeepSeek-V3.2 was used in this study). Smaller or less capable models might introduce noise during the extraction and abstraction phases.
- Text-Only Modality: The current framework is strictly tailored to textual interactions. Extending MemWeaver to handle multimodal inputs—such as images or audio from long-term user interactions—remains an open and promising direction for future research.
Summary updated