GrepMem lets agents outperform summarization with regex search
The non-obvious point is that a lossless log with lexical search can beat learned summarization pipelines, challenging the default of embedding-based agent memory. Developers building long-horizon agents should benchmark grep-style retrieval before adding vector stores, especially since no extra model is needed and token-cost tradeoffs are favorable. The result on Qwen3.5-9B gives open-model teams a concrete recipe to replicate and compare against SUPO-style summarization.
A new method called GrepMem claims that an append-only plain-text log combined with a regex search tool beats summarization and structured memory for long-horizon agents. The agent keeps its full history as text and searches the log on demand, requiring no embeddings, no retrieval index and no extra model.
The team trained Qwen3.5-9B with reinforcement learning under five context strategies. GrepMem reaches 95-97% on ContextBench, where lossy context methods reach at most 21%, and it beats SUPO summarization by 8.8 points on BCP-Multi while staying on the accuracy-and-token-cost Pareto frontier across all five tasks.
The authors argue summarization fails because it decides what to keep before the agent knows what it will need later, whereas the log preserves everything and search retrieves details when required. For developers of agent frameworks, the result suggests lightweight lexical search may be a competitive baseline against embedding-based memory systems.
Is grep all you need?
This work claims that an append-only text log plus a regex search tool beats summarization and structured memory for long-horizon agents.
(bookmark it)
GrepMem keeps the agent's full history as plain text and lets it search that log when it needs something. It does not need embeddings, a retrieval index, or an extra model.
They trained Qwen3.5-9B with RL under five context strategies. GrepMem reaches 95-97% on ContextBench, where lossy methods reach at most 21%. It beats SUPO summarization by 8.8 points on BCP-Multi and stays on the accuracy-and-token-cost Pareto frontier on all five tasks.
Why does it hold up? Summaries decide what to keep before the agent knows what it will need later. The log keeps everything, and search finds the detail on demand.
https://t.co/DUQRAov55f
Chat with Paper: https://t.co/VneazyaknZ
This report is categorized under AITOP's "Papers" desk, focusing on China's AI industry and domestic foundation model ecosystem. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include GrepMem, Qwen, agents, RAG.
Source attribution: curated from DAIR.AI (@dair_ai).