研究指出,在编码智能体需精确定位证据(如符号、函数名、错误信息)的任务中,基于grep的精确字符串搜索比向量检索更具优势。关键在于,检索性能高度依赖智能体的设计框架——结果呈现方式(内联、文件或CLI)会极大影响搜索效果。论文挑战了“智能体栈必须始于嵌入”的默认假设,强调应区分任务类型:是语义发现问题,还是证据定位问题。对于后者,为模型提供原始工具、清晰上下文和精确搜索的框架,往往比构建复杂索引更有效。向量数据库在模糊语义搜索和大规模场景中仍有价值。
Is Grep All You Need?
The surprising result is not that grep is powerful, but that agent design makes it powerful.
The paper says not that grep beats vectors, but that agents fail or win through their harness.
That sounds like a small distinction until you look at what was actually tested.
The authors compare grep-style search and vector retrieval across LongMemEval tasks, where agents must recover facts from long conversation histories full of distractors. Inline grep beats inline vector across every harness-model pair in their main experiment, sometimes by wide margins.
The tempting headline is that vector databases are overbuilt for coding agents.