Just-In-Time Agent Memory with Runtime Agentic Research
Bingyu Yan, Chaofan Li, Hongjin Qian, Shuqi Lu, Chaozhuo Li, Zheng Liu
Abstract
Memory is critical for AI agents. Many existing agent-memory systems follow an Ahead-of-Time (AOT) design, constructing memory before a specific request arrives. While this reduces online serving cost, such request-agnostic memory construction can discard fine-grained information that later becomes important. To address this limitation, we propose Just-In-Time Agent Memory (JAM), a trainable framework for query-conditioned context construction at runtime. A Memorizer preserves complete raw histories in a hierarchical page-store with compact navigational summaries, while a Researcher iteratively retrieves, inspects, and integrates evidence for each request. To train these memory-use behaviors, we introduce Memory-Gym, an evidence-grounded data synthesis pipeline covering nine task types across six domains, and optimize the Researcher through verified-trajectory supervised fine-tuning followed by Hint-guided Group Relative Policy Optimization. We demonstrate the effectiveness of JAM across a variety of benchmarks on agent memory and long-context processing, where it achieves stronger task performance than AOT-style memory systems while remaining substantially more efficient than prior trained agentic memory approaches. To support reproducibility and future research, we release our anonymized source code at https://github.com/VectorSpaceLab/general-agentic-memory.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI, cs.IR, cs.LG
Related papers
Failure Broadens, Success Sharpens: Continual Adaptation of Tool-Use Agents Across Diverse Tasks with Dual-Polarity Memory
Shared title terminologycs.CLTianmai M. Zhang, Hoda Shajari, Amr Hendy et al.
Leto: Utility-Centric Agent Memory
Shared title terminologycs.CLShuguang Chen, Salman Paracha
Personalized State-Transition-Aware Memory for Clinical Agents
Shared title terminologycs.CLMaryam Haghifam, Zahra Rajabi, Yizhou Sun et al.
Evaluating Bounded Autonomy in Regulated Agentic AI: A Diagnostic Harness with Constitutional Rewards, Escalation Labels, and Runtime Governance
Shared title terminologycs.CLDipankar Sarkar
DeepRewind: Predicting and Repairing Premature Commitments in Deep Research Agents
Shared title terminologycs.CLAmirhossein Abaskohi, Amirhossein Dabiriaghdam, Lele Wang et al.
HeurEvo: Agentic Evolution of Hybrid Solver-Augmented Heuristics for Time-Critical Mathematical Optimization
Shared title terminologycs.CLFeijie Wu, Hugo Barbalho, Konstantina Mellou et al.