让大模型用关键事实触发完整记忆,保留原始上下文。
AnchorMem: Anchored Facts with Associative Contexts for Building Memory in Large Language Models

- 用原子事实作锚点,分离检索与生成上下文。
- 构建事件关联图,强化跨记忆融合能力。
- 适合需要长期记忆的对话与推理任务。
尽管大语言模型在复杂任务中表现卓越,仍需记忆系统以利用长期交互中的历史经验。现有方法(如 A-Mem、Mem0)过度依赖频繁重写交互来组织记忆,但这种总结式处理易稀释关键上下文细节并掩盖重要检索特征。为此,我们提出 AnchorMem,受认知科学中普鲁斯特现象启发——特定锚点可触发整体回忆。该框架将检索单元与生成上下文解耦:从交互历史中提取原子事实作为检索锚点,同时保留原始上下文为不可变内容。为揭示隐含叙事线索,构建高阶事件关联图,将相关事实集绑定为共享事件表征,实现无需通用实体作为桥梁的跨记忆整合。检索时,系统以具体事实和事件锚定查询,但通过关联的原始片段与事件重建上下文。实验在 LoCoMo 基准上对三种闭源与开源模型验证表明,AnchorMem 显著优于基线。代码已公开于 https://github.com/RayNeo-AI-2025/AnchorMem。
原文摘要 · Abstract (English)
While large language models have achieved remarkable performance in complex tasks, they still need a memory system to utilize historical experience in long-term interactions. Existing memory methods (e.g., A-Mem, Mem0) place excessive emphasis on organizing interactions by frequently rewriting them, however, this heavy reliance on summarization risks diluting essential contextual nuances and obscuring key retrieval features. To bridge this gap, we introduce AnchorMem, a novel memory framework inspired by the Proust Phenomenon in cognitive science, where a specific anchor triggers a holistic recollection. We propose a method that decouples the retrieval unit from the generation context. AnchorMem extracts atomic facts from interaction history to serve as retrieval anchors, while preserving the original context as the immutable context. To reveal implicit narrative cues, we construct an associative event graph that uses higher-order event links that bind sets of related facts into shared event representations, strengthening cross-memory integration without relying on generic entities as bridges. During retrieval, the system anchors queries to specific facts and events to locate relevant memories, but reconstructs the context using the associated raw chunks and events. Our method reconciles fine-grained retrieval with the contextual integrity of interactions. Experiments across three closed-source and open-source models on the LoCoMo benchmark demonstrate that AnchorMem significantly outperforms baselines. Code is available at https://github.com/RayNeo-AI-2025/AnchorMem.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。