重新思考如何记忆:超越终身LLM智能体记忆中的原子事实
Rethinking How to Remember: Beyond Atomic Facts in Lifelong LLM Agent Memory
May 19, 2026
作者: Jingwei Sun, Jianing Zhu, Jiangchao Yao, Tongliang Liu, Bo Han
cs.AI
摘要
为了实现可靠的长期交互,大语言模型智能体需要一种能够忠实存储、高效检索并对累积对话历史进行深度推理的记忆系统。现有方法大多采用基于事实提取的范式:通过手工设计的静态提示将原始对话压缩为原子事实,再对这些事实进行存储、匹配并注入下游推理过程。然而,这种以事实为中心的设计不可避免地会丢失原始对话中的细粒度细节,且难以支持对分散孤立事实的深度推理。此外,静态提示在不同对话风格的场景下无法保持一致的提取粒度。为解决这些限制,我们提出TriMem,该方法维护三种共存的表征粒度:通过源标识符锚定的原始对话片段(保障存储保真度)、提取的原子事实(实现高效记忆检索)、以及将分散事实聚合为整体语义理解的综合画像(支持深度推理)。我们进一步采用基于TextGrad的提示优化技术,通过响应质量反馈迭代优化提取与画像提示,在不更新任何参数的情况下实现终身进化。在LoCoMo和PerLTQA数据集上基于多种大语言模型骨干网络的实验表明,TriMem持续优于强基线记忆方法。相关代码已开源至https://TMLR-TriMem.github.io。
English
To enable reliable long-term interaction, LLM agents require a memory system that can faithfully store, efficiently retrieve, and deeply reason over accumulated dialogue history. Most existing methods adopt an extracted fact based paradigm: handcrafted static prompts compress raw dialogues into atomic facts, which are then stored, matched, and injected into downstream reasoning. Nevertheless, such fact-centric designs inevitably discard fine-grained details in original dialogues and fail to support deep reasoning over scattered isolated facts. Moreover, static prompts cannot maintain consistent extraction granularity across diverse dialogue styles. To address these limitations, we propose TriMem, which maintains three coexisting representation granularities, including raw dialogue segments anchored by source identifiers for storage fidelity, extracted atomic facts for efficient memory retrieval, synthesized profiles that aggregate dispersed facts into holistic semantic understanding for deep reasoning. We further adopt TextGrad-based prompt optimization, which iteratively refines extraction and profiling prompts via response quality feedback, achieving lifelong evolution without any parameter updating. Extensive experiments on LoCoMo and PerLTQA across multiple LLM backbones demonstrate that TriMem consistently outperforms strong memory baselines. The code is available at https://TMLR-TriMem.github.io .