Remember When It Matters: Proactive Memory Agent for Long-Horizon Agents

Yifan Wu, Lizhu Zhang, Yuhang Zhou, Mingyi Wang, Bo Peng, Serena Li, Xiangjun Fan, Zhuokai ZhaoarXiv 2026

TL;DR

Long-horizon LLM agents frequently suffer from "behavioral state decay," where critical task constraints and past failure diagnoses fade from influence as the interaction history grows. This paper introduces a proactive, plug-and-play Memory Agent that runs alongside an unmodified action agent, maintaining a structured memory bank and selectively deciding when to inject targeted reminders or remain silent. This active intervention strategy significantly boosts performance across complex benchmarks, outperforming passive memory retrieval and always-on prompting.

What Problem Does This Paper Address?

As LLM agents are deployed on increasingly complex, long-horizon tasks—such as autonomous command-line execution or multi-turn customer service—their interaction histories expand dramatically. The authors identify a key failure mode in this setup called behavioral state decay: even when crucial information (like a specific task constraint or a previously discovered bug diagnosis) remains within the model's context window, it often stops reliably influencing the agent's next action.

Traditional agent memory systems focus heavily on storage and passive retrieval (e.g., vector search). However, long-horizon execution introduces a control dilemma: surfacing too little memory leads to repeated mistakes, while surfacing too much adds latency, consumes tokens, and distracts the agent. The core challenge addressed here is determining exactly when remembered information should actively intervene in the agent's control loop.

Methods

The authors propose a decoupled, two-phase architecture featuring a separate Memory Agent that operates alongside an unmodified Action Agent.

System integration overview

At fixed intervals, the Memory Agent intercepts the trajectory and executes a two-phase workflow:

  1. Phase 1: Bank Management: The memory agent uses a constrained tool-call interface (save_knowledge, save_procedural, update_status, delete) to update a structured memory bank. This bank separates stable environment facts and task rules (knowledge) from historical attempts and error logs (procedural).
  2. Phase 2: Context Decision: Instead of automatically dumping this data into the action agent, the memory agent evaluates the current state and chooses either to emit a concise, targeted reminder (<context_for_action>) or explicitly remain silent (<no_intervention/>).
Memory agent internal two-phase workflow

While the system can be powered by prompting frontier models, the authors also demonstrate that this policy can be distilled into an open-weight model (Qwen3.5-27B). They train it using Supervised Fine-Tuning (SFT) to master the structured bank interface, followed by Reinforcement Learning via Group Relative Policy Optimization (GRPO) to calibrate the timing of its interventions.

Datasets

The architecture was evaluated on two distinct long-horizon benchmarks:

  • Terminal-Bench 2.0: A benchmark testing autonomous command-line agents on realistic engineering and debugging tasks within containerized environments.
  • $\tau^2$-Bench: A conversational tool-use benchmark simulating real-world service domains (airline, retail, telecom) governed by complex, multi-turn business policies.
  • SETA: A dataset of executable terminal tasks with verifier rewards, utilized specifically for training and validating the open-weight Qwen memory policy.

Key Insights and Ideas

  • Memory as an Intervention Policy: The paper shifts the paradigm from "what to remember" to "when to interrupt." Knowing when to stay silent is just as critical to an agent's success as knowing what to recall.
  • Decoupled & Plug-and-Play: Because the memory agent runs externally and only modifies the transient context of the action agent at call time, it can be seamlessly paired with any frontier LLM without retraining the core actor.
  • The Failure of "Always-On" Exposure: Simply exposing the entire memory bank at every step or forcing a reminder actually degrades performance compared to selective intervention. Proactive calibration prevents cognitive overload for the action agent.

Key Results

The proactive memory agent delivered consistent performance gains across different benchmarks and model strengths:

Main empirical results on Terminal-Bench and $\tau^2$-Bench
  • Prompted Performance: When using Claude Opus 4.6 as the memory agent, Claude Sonnet 4.5 saw a +8.3 percentage point (pp) lift on Terminal-Bench 2.0 and a +6.8 pp average lift on $\tau^2$-Bench. Stronger action agents (Opus 4.6 paired with itself) also improved by over +2 pp.
  • Ablation Dominance: As shown in the ablation studies, the full two-phase memory agent outperformed alternative strategies, including exposing the full bank continuously, forcing reminders at every step, and using a standard production memory layer like Mem0.
Ablation studies on $\tau^2$-Bench
  • Open-Weight Transfer: The Qwen3.5-27B memory agent trained on SETA via SFT + GRPO successfully transferred to the held-out Terminal-Bench 2.0, boosting the performance of a frozen action agent by +3.5 pp.

Limitations and Future Work

  • Fixed Scheduling: The memory agent currently runs on a rigid, predefined step schedule. The authors note that a dynamic trigger—invoking memory only after tool errors, test failures, or major context shifts—would be more efficient.
  • Calibration Errors: The memory agent occasionally suffers from overconfidence, surfacing speculative inferences or unnecessary warnings that cause the action agent to waste turns performing redundant verifications.
  • Co-training Potential: The current setup keeps the action and memory agents entirely independent. Jointly training both models could allow them to develop a more efficient, specialized communication protocol.

Summary updated

BibTeX
@misc{wu2026remember,
  author = {Yifan Wu and Lizhu Zhang and Yuhang Zhou and Mingyi Wang and Bo Peng and Serena Li and Xiangjun Fan and Zhuokai Zhao},
  title = {{Remember When It Matters: Proactive Memory Agent for Long-Horizon Agents}},
  year = {2026},
  eprint = {2607.08716},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.08716},
}
Figure