REM: What to Store, When to Recall, What to Forget in Experience Memory for Coding Agents
On the map: LLM agents and tool use → Agent memory systems
Abstract (arXiv)
Large language model (LLM) agents now autonomously complete long-horizon tasks, such as repository-level coding, through hundreds of think-act steps, yet the experience each run produces is rarely reused on the next. Prior memory systems concentrate on retrieval, finding the most relevant past trajectory. Retrieval cannot observe the running agent, so it cannot decide whether the agent needs an experience, at which point, or for how long. We introduce REM (Reusable Experience Memory), a framework that manages the memory lifecycle from inside the agent's think-act loop through three explicit decisions. What to store: each completed trajectory is consolidated into a phase-structured document, two orders of magnitude smaller than the trajectory. When to recall: the document is injected at the start of the task; the costlier implementation record is withheld until an in-loop gate detects the agent struggling. What to forget: the record is evicted after a single exposure. On repository-level bug fixing (SWE-ContextBench Lite), REM retrieves the related trajectory more accurately than every state-of-the-art memory system (68.7% vs. 55.6% match@1) and improves, in every replicate, end-task resolution (27.6% vs. 24.9%) at 17% lower cost. Injecting the same experience as a summary or raw trajectory, even when oracle-retrieved, does not. Ablating any of the three decisions reduces resolution. Altogether, these results demonstrate that the bottleneck in experience reuse is not retrieval fidelity but how experience is stored and governed across its lifecycle, opening a control-theoretic perspective on agent memory.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 17 of its 18 references that are in the map. Submitted 19 Oct 2026.
Builds on
17 of 18 references.
Closest ancestors · 5
Same direction, newest first
- 2026Memory as a Controlled Process: Learned Adaptive Memory Management for LLM Agents15 Jul
- 2026When Continual Learning Moves to Memory: A Study of Experience Reuse in LLM Agents29 Apr
- 2025Memory as Action: Autonomous Context Curation for Long-Horizon Agentic Tasks14 Oct
- 2025ReasoningBank: Scaling Agent Self-Evolving with Reasoning Memory29 Sep
- 2025Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory28 Apr
Other references · 12
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,789
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,871
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,765
- 2023Voyager: An Open-Ended Embodied Agent with Large Language Modelscited by 2,483
- 2023Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflectioncited by 1,978
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,205
- 2023ExpeL: LLM Agents Are Experiential Learnerscited by 1,067
- 2023Large Language Models Can Be Easily Distracted by Irrelevant Contextcited by 909
- 2024Agent Workflow Memorycited by 482
- 2024AutoGuide: Automated Generation and Selection of Context-Aware Guidelines for Large Language Model Agentscited by 90
- 2026Structurally Aligned Subtask-Level Memory for Software Engineering Agentscited by 15
- 2026SWE Context Bench: A Benchmark for Context Learning in Codingcited by 14
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025How Memory Management Impacts LLM Agents: An Empirical Study of Experience-Following Behavior
- 2026MemHarness: Memory Is Reconstructed, Not Replayed
- 2026Learning to Remember: Advances in Memory Mechanisms for Large Language Models ↗
- 2026What to Keep, What to Forget: A Rate--Distortion View of Memory Compaction in LLMs and Agents
- 2026Memory for Autonomous LLM Agents:Mechanisms, Evaluation, and Emerging Frontiers
- 2026Coding Agent Memory Post-Training II: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via On-Policy Distillation
- 2026MemoWM: How World Models Change What Agents Need to Remember
- 2026Measure Before You Manage: Evaluating Agent Working Memory in Coding Agents