即时记忆:学习为LLM智能体策划任务自适应记忆

·

研究论文 · 2026/09/24

现有智能体记忆系统大多在写入时进行记忆整理:任务完成后将轨迹提炼为固定产物(如反思、工作流、技能或推理策略),之后按相似度检索。这迫使系统在未知未来查询前就决定记住什么,不可逆地丢弃信息,并产生必须服务多种下游任务的查询无关摘要。学习这种写入时整理器也很困难,因为存储决策的价值可能要到相关查询出现时才显现,可能相隔多个任务,形成长时程信用分配问题。我们转而保留原始轨迹,将整理推迟到读取时,此时当前任务已知。给定检索到的轨迹和新任务,记忆整理器合成紧凑、任务自适应的载荷,针对即时需求。由于该载荷在同一任务上被消费,整理器可直接从即时任务成功中训练,避免延迟效用信号和人工分组相关任务的需要。在 ALFWorld、WebShop 和 τ^2-bench 上,我们的 Just-in-Time Memory (JitMem) 持续优于无记忆智能体以及启发式和学习的写入时记忆方法,分别比最强基线提升 16.2、16.3 和 3.9 个绝对成功率点。值得注意的是,即使未训练的整理器也已与这些基线相当或超越,表明任务自适应的读取时整理本身是主要增益来源;训练整理器进一步复合提升。

该工作重新思考了智能体记忆的整理时机,通过将整理推迟到读取时并利用即时任务反馈训练,显著提升了任务成功率,为构建更有效的智能体记忆系统提供了新方向。

Agentic memory systems reuse past experience to improve future performance, yet most existing designs curate memory at write time: once a task is completed, its trajectory is distilled into a fixed artifact, such as a reflection, workflow, skill, or reasoning strategy, that is later retrieved by similarity. This forces the system to decide what is worth remembering before the future query is known, irreversibly discarding information and producing a query-independent summary that must serve many possible downstream tasks. Learning such a write-time curator is also difficult because the value of a storage decision may only become apparent when a relevant query arrives, potentially many tasks later, creating a long-horizon credit-assignment problem. We instead retain raw trajectories and defer curation until read time, when the current task is known. Given the retrieved traces and the new task, a memory curator synthesizes a compact, task-adaptive payload tailored to the immediate need. Because this payload is consumed on the same task, the curator can be trained directly from immediate task success, avoiding delayed utility signals and the need to artificially group related tasks. Across ALFWorld, WebShop, and τ^2-bench, our Just-in-Time Memory (JitMem) consistently outperforms no-memory agents as well as heuristic and learned write-time memory methods, improving over the strongest baseline by 16.2, 16.3, and 3.9 absolute success-rate points, respectively. Notably, even an untrained curator is already competitive with or surpasses these baselines, showing that task-adaptive read-time curation itself is a major source of the gain; training the curator further compounds the improvement.

阅读原文

参与讨论