Reproduce “SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agents” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Shuzheng Gao, Wenhao Zeng, Zhaojian Yu, Jianqiao Wangni, Chaozheng Wang, Kai Cai, Shilin He, Michael R. Lyu

SWE-MeM lets coding agents choose when to compress interaction history, which span to replace, and what summary and remaining-work note to retain. The authors train this flexible memory tool through supervised fine-tuning and reinforcement learning. With Qwen3-Coder-30B-A3B, OpenHands, and a 32K context, it resolves 60.2% of SWE-Bench Verified cases versus 38.6% for ReAct, using fewer tokens but more steps.

Key insights

  • Integrating memory management as an intrinsic, learned capability allows agents to adaptively curate context, overcoming the limitations of static compression rules.
  • The benefits of a flexible memory tool extend beyond merely preventing context overflow, actively contributing to a cleaner and more effectively utilized working context for the LLM.
  • A multi-stage training approach combining synthesized data, curriculum fine-tuning, and memory-aware reinforcement learning is effective for instilling complex, proactive memory management behaviors in agents.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.