enm-agent: Equipping LLM Agents with Memory Using RL
Abstract
Context remains a persistent bottleneck for LLM agents: it is a hard limit on what a model can attend to, a softer one given that effective context length lags far behind the claimed maximum, and a source of compute and memory cost that grows with every token. We argue that much of this can be offloaded to an external, editable memory rather than the context window. To this end we craft an Obsidian-style markdown memory scaffold, organised as files in folders and operated through Python tools by a ReAct-style agent, supporting retrieval, update and clarification. We generate synthetic training data for these tasks with a graph-based pipeline, and train enm-agent on top of Qwen3-4B-Thinking-2507 using GSPO. On our handcrafted md-memory-bench, enm-agent reaches 0.75, second in our evaluation and a 92% gain over its 0.39 base. On the out-of-distribution MemoryAgentBench LongMemEval-S*, our markdown scaffold lifts a 4B backbone from 0.00% (MemGPT) and 7.00% (the off-the-shelf Mem0) to 12.67%, with RL lifting it further to 15.30%. Our results show that a simple markdown scaffold is what makes a small model usable for long-memory tasks, with RL providing an additional gain on top.