Working Notes on Agent Systems/Brad Zhang

@teach_fireworks / X longform

Is Grep All You Need? If you are still thinking of “rag = Vector Database” as the defau...

Is Grep All You Need? If you are still thinking of “rag = Vector Database” as the default answer, then I recommend that you read this paper. It is a bit counterintuitive: the au...

May 16, 2026 · 3 min read

Is Grep All You Need? If you are still thinking of “rag = Vector Database” as the defau...
Figure 1 / source image

Is Grep All You Need?

If you are still thinking of “rag = Vector Database” as the default answer, then I recommend that you read this paper.

It is a bit counterintuitive: the author found that in many real Agent scenarios, the most simple grep is actually better than vector retrieval.

This is not to say that vector retrieval is worthless, but it pokes a question that many people have not seriously thought about: is it really the retrieval itself that we usually optimize, or is it just the illusion of indulging in some "advanced component"?

One: Many teams today do rag, the first reaction is embedding, rerank, vector library, recall link, it looks very advanced, but what really affects the results is how the Agent searches, how to read, and how to feed the results to the model.

That is, the problem is not just in retrieval, but in the engineering closed loop of the entire agentic search.

Two: In the inline way, that is, when the tool results are directly crammed into the model context, grep basically leads the way.

Behind this is actually very easy to understand - many questions are not for you to "find similar semantic content", but for you to accurately hit that word, that sentence, that point in time, that name.

At this time, the "local method" of lexical search is more reliable.

Many people lose not to the model, but to "retrieving too smartly, and as a result, not detecting what really needs to be retrieved".

Three: The retrieval effect is good, not equal to the effect of the Agent system.

A key finding in the paper is that inline performs well, but once it is replaced with file-based delivery, that is, the results are written into the file and then read by the model, the effect may be significantly reduced.

This shows that the real difficulty is whether the model can steadily consume these results.

Many systems do not die from recall, but from the loss of tool call chains, context routing, and intermediate steps.

Four: If your task is more like finding evidence, finding original words, and finding certain factual fragments, then things like grep/BM25 should really be valued again.

If your task is more like finding similar semantics, finding relevant context, and doing open induction, vector retrieval is certainly valuable.

The really mature approach is to do routing by task type, mixed retrieval by scenario, and evaluation by system link.

Don't just look at the searcher itself, look at whether the entire Agent has finally handed over the correct answer steadily.

Rag is a complete Agent engineering issue.

Many times, the so-called "advanced solutions" are not necessarily stronger; the really strong systems are often those who use simple methods to get the details of the link right.

Rag should be made into an observable, routable, and evaluable retrieval action system.

The value of this paper is not to get everyone back to grep, but to remind us not to think of the retrieval layer in the Agent as an isolated API; true system capabilities are hidden in harness, tool interfaces, contextual delivery, and failure recovery.

Visual summary

Article argument map

Generated from the post's content graph

FORMATTOPICCAPABILITYMARKETcoverscoverscoverscoverscoverssignalssignalssignalsFORMATarticle featureTOPICagentsTOPICharness engineeringTOPICtechnical distributionTOPICmemoryTOPICretrievalCAPABILITYagent workflowCAPABILITYharness engineeringCAPABILITYevaluationCAPABILITYproduct surface
Mermaid outline
flowchart LR
  format-article["article feature"]
  topic-agents["agents"]
  topic-harness-engineering["harness engineering"]
  topic-technical-distribution["technical distribution"]
  topic-memory["memory"]
  topic-retrieval["retrieval"]
  capability-agent-workflow["agent workflow"]
  capability-harness-engineering["harness engineering"]
  capability-evaluation["evaluation"]
  capability-product-surface["product surface"]
  format-article -->|covers| topic-agents
  format-article -->|covers| topic-harness-engineering
  format-article -->|covers| topic-technical-distribution
  format-article -->|covers| topic-memory
  format-article -->|covers| topic-retrieval
  format-article -->|signals| capability-agent-workflow
  format-article -->|signals| capability-harness-engineering
  format-article -->|signals| capability-evaluation

Visual structure

Essay structure map

Built from summary and key paragraph positions

Is Grep All You Need? If you are still thinking of “rag = Vector Database” as the def...THESISIs Grep All You Need?If you are stillthinking of “rag =Vector Database” asSIGNALIs Grep All You Need?OPERATORA key finding in thepaper is that inlineperforms well, butonce it is replacedIMPLICATIONThe value of thispaper is not to geteveryone back to grep,but to remind us not
Mermaid outline
flowchart LR
  thesis["Is Grep All You Need? If you are still thinking of “rag = Vector Database” as the default answer, then I re..."]
  signal["Is Grep All You Need?"]
  operator["A key finding in the paper is that inline performs well, but once it is replaced with file-based delivery,..."]
  implication["The value of this paper is not to get everyone back to grep, but to remind us not to think of the retrieval..."]
  thesis -->|frames| signal
  signal -->|develops| operator
  operator -->|lands in| implication

Source: View the original post