arXiv:2610.25561cs.NEOct 2026

Manuscript Offprint

arXiv:2610.25561

Let Them Sleep: Recursive Self-Pruning Memory for Long-Horizon LLM Agents

Kargi Chauhan, Sadiba Nusrat Nur, Pratibha Revankar, Kyle Montgomery, Chenguang Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Agents that run for a long time have a memory problem, and it is not the one most systems optimize for. Storing every trace and retrieving the nearest neighbors works early and quietly stops working later: the store fills up with failures the agent then repeats, and with facts that were true fifty turns ago. RSPM (Recursive Self-Pruning Memory) borrows the fix biology already found. At intervals the agent sleeps. It clusters its recent failures, distills each cluster into a short rule, and deletes the raw episodes it just learned from. Rules decay unless something reinforces them, and rules that recur across many contexts get promoted into general ones. We tested this on three settings with little in common: 19,008 SWE-bench issues, temporal consistency across 12 conversational benchmarks, and long-horizon QA on LoCoMo. Performance rose by 7.6 to 11.9 points in each. More interestingly, three separately tuned experiments landed on nearly the same equilibrium, roughly 93% fewer retry loops and roughly 30% less stored memory, which suggests that knowing what to forget is a general property of agent memory rather than a benchmark-specific trick.

1 Memory debt

Long-running agents are now common. One works through GitHub issues at SWE-bench scale [Jimenez et al., 2024], another holds a conversation across thirty sessions, another answers questions pointing back to an arbitrary turn in dialogues of several hundred turns [Maharana et al., 2024]. The usual design assumption is that memory should only grow: keep every trace, retrieve the closest matches [Lewis et al., 2020]. Closest cousins either page memory across tiers [Packer et al., 2023], decay unused traces [Zhong et al., 2024], or store lessons alongside experience rather than in place of it [Shinn et al., 2023, Wang et al., 2024]—none consolidate then delete. In our experiments, the grow-only assumption broke down the same way in every domain.

The store bloats first, since entries accumulate linearly while the useful capacity of top-k retrieval does not, so a naive conversational baseline ends up holding 675 entries and surfacing five. Then the agent starts repeating itself: a failed approach is stored verbatim, looks relevant later, and gets tried again. We measure these retry loops at 5.9% to 6.7% of all attempts, in software engineering and in QA alike. Finally, the store goes stale. A note about a deprecated API, or a preference the user changed forty turns ago, still carries full weight, and baseline accuracy slides from about 70% to about 58% as a conversation runs past 100 turns. Biology settled this long ago: during slow-wave sleep the hippocampus replays recent episodes while the neocortex extracts the pattern, so the episode goes and the lesson stays [Stickgold, 2005, McClelland et al., 1995], and whatever is not consolidated decays on the Ebbinghaus curve [Ebbinghaus, 1885]. RSPM writes those two observations down as an algorithm.

37th Conference on Neural Information Processing Systems (NeurIPS 2023).