GrepMem 用纯文本日志加正则搜索做长程智能体记忆
有人用一条纯文本日志加 grep 替代智能体记忆系统,ContextBench 上做到 95-97%,比摘要方法 SUPO 高 8.8 个点,还不用向量库。做长程智能体的开发者可以看看这个思路,能省不少基础设施。
一项新工作提出 GrepMem:把智能体的完整历史保存为可追加的纯文本日志,需要时用正则搜索工具(grep)按需检索,不用 embeddings、检索索引或额外模型。作者用 RL 在五种上下文策略下训练 Qwen3.5-9B,GrepMem 在 ContextBench 上达到 95-97%,而有损压缩方法最高只有 21%。相比 SUPO 摘要方法,它在 BCP-Multi 上高出 8.8 个百分点,并在全部五个任务上处于准确率与 token 成本的 Pareto 前沿。
作者解释其有效性的原因:摘要方法在智能体还不知道未来需要什么时就要决定保留哪些内容,容易丢掉关键细节;而完整日志保留一切,搜索可以在需要时精确找回信息。这省去了向量库和记忆模型等基础设施,实现成本也低。
对开发者而言,这提示长程智能体的记忆方案可以大幅简化:一条 append-only 日志加正则搜索即可替代摘要式和结构化记忆,尤其适合需要长期运行、上下文预算敏感的智能体应用。
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
本条情报归属 AITOP「论文」核心栏目,重点聚焦中国 AI 产业与国产大模型生态。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:GrepMem、Qwen、智能体、RAG,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。
信源核验说明:本文原始线索采编自「DAIR.AI」(@dair_ai),经 AITOP 多维评分管线结构化提炼。