Agentic Search vs. Vector Search
Why many agents now search like a developer — grep, read, follow links — instead of relying on a vector index, and how to choose between them.
Watch a coding agent find its way around an unfamiliar codebase and you'll notice something surprising: it doesn't consult a vector database. It lists the folders, searches for a function name, opens the file, spots an import, follows it to another file, and searches again. It looks a lot like an experienced developer at a terminal. And for most coding tasks it works better than the embedding-based retrieval you learned in the previous two lessons.
This lesson explains that approach, called agentic search, and when it beats a vector index. You'll learn why many agent builders moved to it, where vector search still clearly wins, how to combine the two, and how to organize your own files and documents so agents can search them well. You'll also build a small set of search tools that give any agent you write the same abilities.
What agentic search is
Agentic search means the agent finds information by using ordinary search tools iteratively, deciding each next step based on what it just found. The typical tools are:
| Tool | What it does | Developer equivalent |
|---|---|---|
| List / glob | Find files by name or pattern (**/*refund*) | ls, find |
| Grep | Find exact text or patterns inside files | grep, rg (ripgrep) |
| Read | Open a file, or a range of lines in it | cat, an editor |
| Follow links | Open whatever a file points to: imports, links, references | Jump to definition, click a link |
| Web search / fetch | The same moves, applied to the internet | A browser |
The agent combines them in a loop. Asked "where do we calculate late fees?", it might grep for late fee, get twelve hits, notice most are in src/billing/, read fees.ts, see that it imports a penaltyRate from a config file, open that file, and answer with exact line numbers. No index was built in advance. The "retrieval" is just the agent being curious in a disciplined way.
You've already seen the seed of this idea. In Managing Long Context, just-in-time retrieval meant giving the agent references and tools instead of pasting everything in. Agentic search is that principle applied to finding things.