GrepMem keeps full agent history as plain text and searches it with regex
When an agent's conversation outgrows the context window, what should be dropped and what kept? Existing approaches — summarisation, masking or structured memory — must decide before anyone knows what will be needed later, and compression can lose details that turn out to matter. The authors propose GrepMem: write the agent's full history to an append-only plain-text log, plus a regex search tool to look things up on demand, with no embeddings, retrieval index, memory extraction or extra model. They trained with reinforcement learning on Qwen3.5-9B and compared five context-management strategies, reaching 95-97% accuracy on ContextBench where the best lossy baseline reached only 21%; on BCP-Multi it beat SUPO's summarisation method by 8.8 percentage points, and it sat on the accuracy-cost frontier on all five evaluation tasks. Limits: only one 9B model was trained and evaluated, the abstract does not say whether code or data are released, and whether the conclusions hold for other models and tasks is untested.
However large the context window gets, it is still finite, and long-horizon tasks eventually run into the problem that the history no longer fits. The common engineering fixes are summarisation or vector indexes, but both require deciding in advance which information is worth keeping, and a wrong call means it can never be recovered.
People building long-horizon agents can set aside the assumption that a vector database or a summariser is mandatory: in single-model experiments, a searchable raw log was already sufficient and cheaper. But this is a result from one 9B model, and it should be re-tested on your own model and tasks before deployment.