arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.02007cs.CLcs.AI
收藏

超越RAG的代理记忆:通过解耦与聚合进行检索

Beyond RAG for Agent Memory: Retrieval by Decoupling and Aggregation

King’s College London(伦敦国王学院);Tencent, Yuanbao Team(腾讯元宝团队)

Zhanghao Hu, Qinglin Zhu, Runcong Zhao, Di Liang, Hanqi Yan, Yulan He, Lin Gui

AI总结:

本文提出xMemory,通过解耦与聚合原则优化代理记忆检索,提升答案质量和推理效率。

摘要:

标准检索增强生成(RAG)难以适应代理记忆。不同于大规模异质语料,代理记忆形成有界且连贯的交互流,其中许多片段高度相关或近似重复。因此,平面top-k相似性检索常返回冗余上下文,而以摘要为中心的层级结构会模糊区分候选人的细微差别。我们主张代理记忆应遵循解耦后再聚合原则:系统应首先隔离可重用的事实、更新和区分细节,然后再组织它们以高效检索。基于此原则,我们提出xMemory,从原始消息构建可修改的层级记忆结构,将交互历史分解为本地事件,将每个片段分解为记忆组件,使用稀疏性-语义忠实性目标将相关组件聚合为高层组,并在记忆演变中逐步维护此结构。在推理时,xMemory采用自上而下的方式检索,首先选择互补的紧凑骨干组和组件,然后仅在额外证据减少读者不确定性时扩展到片段和原始消息。在LoCoMo和PerLTQA跨多种开源和闭源LLM上的实验显示,答案质量和推理令牌效率均有所提升,通过冗余性、证据密度和覆盖性的分析得到支持。

英文摘要:

Standard Retrieval Augmented Generation (RAG) is poorly matched to agent memory. Unlike large heterogeneous corpora, agent memory forms a bounded and coherent interaction stream in which many spans are highly correlated or near duplicates. As a result, flat top-$k$ similarity retrieval often returns redundant context, while summary-centric hierarchies can blur the subtle details that distinguish one candidate from another. We argue that agent memory should follow the principle of decoupling before aggregation: the system should first isolate reusable facts, updates, and distinguishing details from similar histories, and only then organise them for efficient retrieval. Based on this principle, we propose xMemory, which constructs a revisable hierarchical memory structure from original messages to segments, memory components, and groups. xMemory segments interaction history into local events, decouples each segment into memory components, aggregates related components into high-level groups using a sparsity--semantic faithfulness objective, and maintains this structure incrementally as memory evolves. At inference time, xMemory retrieves top-down, first selecting a compact backbone of complementary groups and components, and then expanding to segments and raw messages only when additional evidence reduces the reader's uncertainty. Experiments on LoCoMo and PerLTQA across diverse open source and closed source LLMs show consistent gains in answer quality and inference token efficiency, supported by analyses of redundancy, evidence density, and coverage.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑