Just-in-Time Memory: Learning to Curate Task-Adaptive Memory for LLM Agents
Abstract
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 -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.
Create a lesson
Related papers
HasMem: Hard-Origin Adaptively Softened Memory for Long-Term LLM Agents
Shared title terminologycs.AIZihong He, Junxiao Shen, Chen Liang et al.
Task-Specific Agent Memory For Continual Learning
Shared title terminologycs.AIYezhou Cheng, Runjia Du, Zeming Liu et al.
TACT-Bench: Testing Adaptive Conversational Threats against Tool-Use Agents
Shared title terminologycs.AIIlia Hashemi Rad, Feijie Wu, Haoyu Wang et al.
Learning What vs. Learning How: Decomposing Task and Interface Competence in Agentic Training
Shared title terminologycs.AIChaeeun Lee, Hossein A. Rahmani, Aryo Pradipta Gema et al.
GameDojo: Benchmarking Real-Time Interactive Agents in Video Games
Shared title terminologycs.AIKuan Zhang, Zhihao Yang, Yukun Chen et al.
MMMem: Self-Improving Agents with Task-Aware Multimodal Experience Consolidation
Shared title terminologycs.AIYuxuan Chen, Changwei Lv, Yunfei Li et al.