NeFut Logo NeFut
中 Admin Login

[CS.AI] REM: What to Store, When to Recall, What to Forget in Experience Memory for Coding Agents

Published at: 2026-10-21 22:00 Last updated: 2026-10-22 01:04
#AI #Machine Learning #LLM

Large language model (LLM) agents can now autonomously complete repository‑level coding tasks through hundreds of think‑act steps, yet the experience generated by each run is rarely reused. Existing memory systems focus on retrieval—finding the most relevant past trajectory—but they cannot observe the running agent, so they cannot decide whether the agent needs an experience, when, 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 via three explicit decisions.

What to store: each completed trajectory is consolidated into a phase‑structured document, about two orders of magnitude smaller than the raw trajectory.

When to recall: the document is injected at the start of a 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 the repository‑level bug‑fixing benchmark SWE‑ContextBench Lite, REM retrieves the related trajectory with 68.7% match@1 accuracy, outperforming all state‑of‑the‑art memory systems (55.6%). It also improves end‑task success (27.6% vs. 24.9%) while reducing overall cost by 17%. Injecting the same experience as a summary or raw trajectory, even when oracle‑retrieved, does not achieve these gains. Ablating any of the three decisions degrades performance.

These findings demonstrate that the bottleneck in experience reuse lies not in retrieval fidelity but in how experiences are stored and governed throughout their lifecycle, opening a control‑theoretic perspective on agent memory.

Review

Original Source: https://arxiv.org/abs/2610.27377

[h] Back to Home