arXiv:2606.22844cs.AIcs.MA2026-06被引 2

让大模型记忆能带上下文,避免误用过时信息。

RaMem: Contextual Reinstatement for Long-term Agentic Memory

论文配图:RaMem: Contextual Reinstatement for Long-term Agentic Memory
图 1 · 摘自论文原文
  • 用事件时间、参与者等信息给记忆打上上下文标签。
  • 检索时优先选与当前问题情境匹配的记忆,准确率提升超10%。
  • 适合长期交互的智能体,如客服机器人或个人助手。

长周期交互中,大模型智能体依赖长期记忆来应对不断变化的任务场景。现有记忆系统虽使经验更持久、紧凑且可检索,但单纯检索无法保证记忆对当前问题具有有效证据价值。当经历被压缩为可复用片段时,涉及相同实体或用户状态的记忆可能在不同情境下被同等对待,造成‘上下文坍塌’:记忆丢失了判断其是否适用的关键背景。为此,我们提出RaMem框架,通过四个阶段将检索到的记忆片段转化为可验证的上下文证据:(i) 证据锚定,将每条记忆绑定到原始事件的时间、提及时间、会话跨度和参与者;(ii) 回忆条件推导,从查询中提取隐含的证据条件;(iii) 有效性感知检索,基于条件优先选择上下文兼容的记忆,同时保留内容相关候选作为后备;(iv) 上下文保持合成,确保生成器可访问选定记忆的结构化上下文。在多个长期记忆基准测试中,RaMem相比强基线平均F1提升超过10%,适用于多种模型架构。

原文摘要 · Abstract (English)

Long-term memory has become increasingly important for LLM agents that operate across extended interactions and evolving task contexts. Recent memory systems have made past experiences more persistent, compact, and retrievable, but retrieval alone does not ensure that a memory provides valid evidence for the current query. When experiences are compressed into reusable fragments, memories from different situations may appear equally relevant if they involve recurring entities or user states. We refer to this failure as context collapse: memories lose the surrounding context needed to judge whether they provide valid evidence for the current query. To address this problem, we propose Contextual Reinstatement for Agentic Memory (RaMem), a framework that turns retrieved memory fragments into contextually verifiable evidence. RaMem operates through four coordinated stages: (i) evidence anchoring grounds each memory in its original episodic conditions, especially event time, mention time, session span, and participants; (ii) recall condition induction derives the evidence conditions implied by the query; (iii) validity-aware retrieval uses these conditions to prioritize context-compatible memories while retaining content-relevant candidates as fallback evidence; and (iv) context-preserved synthesis keeps the selected memories' structured context available to the generator. Experiments on long-term memory benchmarks show that RaMem consistently improves performance over strong memory baselines, with average F1 gains of more than 10% across several backbones.

长期记忆智能体上下文检索增强

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。