
Agentic Search vs RAG: Skip the Vector DB
Use agentic search — grep, list, open file, filtered query — when your corpus has structure the agent can navigate. Keep RAG with embeddingswhen it's a mountain of unstructured prose and nobody types the right keyword. Most of the agents I get handed shipped with a vector database they didn't need, and ripping it out made them both cheaper and more accurate.
The Short Answer, By Corpus
Files, folders, a repo, a Drive? Agentic search. Give it list and grep and get out of the way. This is the case Anthropic already settled by pulling vector search out of Claude Code.
A database, a CRM, a ticket system?Agentic search, and honestly it isn't close. You have IDs, statuses, dates and foreign keys. Embedding a customer record so you can find it by vibes is a strange thing to do to a primary key.
Four years of support transcripts nobody tagged?RAG. There's no filter that narrows that, users describe problems in words that never appear in the ticket, and meaning is genuinely the only handle you have.
A 200-page policy PDF? Neither, probably. That fits in context now. Two years of retrieval architecture debate got quietly deleted by context windows getting bigger — I wrote about that in the 1M context window post.
Answering live, inside a phone call? Pre-computed retrieval, because agentic search costs you turns and turns cost you seconds, and a caller hears every one of them.
What Agentic Search Actually Means
Classic RAG decides what the model sees before the model wakes up. You chunk every document, embed the chunks, and at question time a cosine-similarity function picks the top five and pastes them into the prompt. The model gets one shot at whatever the math handed it.
Agentic search inverts that. The model gets tools instead of a payload — list the directory, search for this string, open that file, query the orders table where email = x — reads what comes back, and decides whether it needs another look. Nobody pre-decides relevance. The agent narrows the way you would.
Anthropic's context engineering guidance calls this “just in time” retrieval: agents “maintain lightweight identifiers (file paths, stored queries, web links, etc.) and use these references to dynamically load data into context at runtime using tools.” The agent holds a pointer, not the payload — and dereferences it when it actually needs to.
That's not a research idea. It's the reason Claude Code reads your repo with grep rather than an index, and it's the same instinct behind handing an agent a CLI instead of a wrapper API: the tools people already use are usually better tools than the ones we build for models.
Why Similar Isn't The Same As Relevant
Here's the failure I hit over and over before I stopped defaulting to a vector store. Embeddings retrieve what reads like the question. Very often the thing that answers the question reads nothing like it.
Ask “why did the Tuesday invoice sync fail?” and cosine similarity happily returns three paragraphs of documentation about invoice syncing — topically perfect, useless. The record that answers it is a log line reading ECONNRESET at 03:14, which shares almost no semantic surface with the question. A grep for the date range finds it in one call.
Structure gets flattened too. A chunk boundary doesn't know that a function imports another file, that a ticket has a parent, that a row has a foreign key. Embeddings turn a graph into a bag of paragraphs, then you spend a month writing re-rankers to reconstruct the relationships you deleted.
And then there's staleness, which is the one that actually bit me in production. A client updated their pricing doc; the embedding job ran on a nightly cron; the agent confidently quoted old pricing to prospects for most of a business day. Nothing errored. Nothing alerted. The vector store was doing exactly what it was told. Any retrieval layer that can silently disagree with the source of truth will eventually do so at the worst possible moment.Agentic search can't drift, because it reads the real thing every time.
The Honest Trade, Side By Side
I don't want to sell you the fun half. Agentic search genuinely costs more per answer, and Anthropic says so directly: “runtime exploration is slower than retrieving pre-computed data.” Here's the whole trade.
| What you're comparing | Agentic search | RAG + vector DB |
|---|---|---|
| Latency per answer | 3-6 tool calls, seconds | One lookup, sub-second |
| Tokens per answer | Higher — mostly cacheable | Lower, fixed |
| Infra to run | None beyond your tools | Index, embed job, reindex cron |
| Freshness | Always live | As stale as the last reindex |
| Exact IDs, dates, codes | Excellent | Weak — the classic miss |
| Fuzzy “something like this” | Weak | Excellent — the whole point |
| Debugging a bad answer | Read the tool calls | Inspect chunks and scores |
Read that token row carefully, because it's where people get the cost wrong. Agentic search reads more tokens, but the expensive part — the system prompt and tool definitions — sits in a stable prefix that prompt caching bills at a fraction of the fresh rate. Meanwhile the RAG column's “lower, fixed” number quietly excludes the embedding bill, the vector host, and the engineer maintaining the pipeline. Compare total system cost, not the retrieval call.
Where RAG Still Wins Outright
I'm not anti-vector. I'm anti-default. There are three cases where I reach for embeddings without hesitating.
Large unstructured prose with no filters.Years of chat transcripts, research corpora, regulatory text. Nothing narrows the field, so you need meaning as the index. This is the original job and it's still the right tool.
Vocabulary mismatch between user and source.A customer types “the thing won't charge overnight” and the manual says “battery fails to reach full state of charge during standby.” No keyword search on earth connects those. Embeddings do, effortlessly.
A hard single-hop latency budget. Voice is the obvious one. In real-time voice agents you have a couple hundred milliseconds before the caller notices dead air. You cannot spend that on four exploratory tool calls. Pre-compute and take the staleness risk knowingly.
If you do land here, the store you pick matters less than people think — I broke down pgvector vs Qdrant vs Pinecone and for most workloads Postgres you already run beats a new managed service you now have to operate.
The Hybrid Almost Everyone Lands On
Anthropic's own framing allows for it: “the most effective agents might employ a hybrid strategy, retrieving some data up front for speed, and pursuing further autonomous exploration at its discretion.”
In practice that means semantic search becomes one tool among several, not the front door.Structured lookup and full-text search go first because they're exact, cheap and auditable. Vector search is what the agent calls when the cheap paths come back empty.
The nice side effect is that your index shrinks to the slice that genuinely needs meaning-based recall. That's a smaller embedding bill, a shorter reindex, and far less surface area for the staleness bug I described earlier. Ordering the tools this way isn't a compromise — it's the same “cheapest thing that answers it” principle behind how I cut agent costs generally.
One thing to get right if you build this: the tool descriptions. An agent choosing badly between four retrieval tools is almost always a description problem, not a model problem — it's near the top of n8n's own list of common agent failures. “Looks up a customer order by order ID or email address” works. “Handles data” does not.
What I Actually Ship
My default is now boring: no vector database until a real question fails without one.
The rebuild that convinced me was an internal knowledge agent sitting on a client's Drive, Notion and ticket queue. Version one was textbook RAG — chunk everything, embed nightly, top-k into the prompt. It was fine at “explain our refund policy” and hopeless at “what did we tell Acme in June,” which is what people actually asked. Version two dropped the index entirely and gave it four tools: search Drive, read a doc, query tickets by account and date, read a ticket. Fewer moving parts, no nightly job, and the answers stopped being confidently wrong about specifics. It costs more per question. Nobody has ever mentioned that; they mention that it's right now.
Where I do keep embeddings, it's a narrow slice — usually one folder of long-form prose — exposed as one tool the agent may call. And I instrument every retrieval agent the same way I'd instrument any other, because “the answer was wrong” is unfixable without traces showing which tool it called and what came back.
The mistake I see most is treating “we need RAG” as a requirement rather than a hypothesis. It arrives in briefs pre-decided, usually because a tutorial made it look like the architecture rather than one option in it. Then six months later somebody owns a reindex cron nobody understands, serving answers a grep would have gotten right.
If you do one thing today:
Take the twenty questions your agent gets most, and for each one ask — could a new hire with folder access and a search box find this?Count them. If it's most of them, your vector database is infrastructure you're maintaining for a minority of your traffic, and the fix is to demote it from front door to fallback tool.
Frequently Asked Questions
What is agentic search and how is it different from RAG?
Agentic search gives the model tools — list, grep or full-text search, open file, filtered query — and lets it decide what to look for, read the result, and search again if that was not enough. Classic RAG embeds every document up front, and at question time retrieves the top-k most similar chunks and stuffs them into the prompt before the model gets a turn. The difference is who decides: in RAG a similarity function decides what the model sees, and in agentic search the model decides, iteratively, using the same handles a person would.
Do AI agents still need a vector database in 2026?
Most do not. If your corpus has structure an agent can navigate — file paths, folders, ticket IDs, customer records, table columns, an API with real filters — plain search tools usually answer better than cosine similarity, and you avoid an embedding pipeline, a chunking strategy and a reindexing job. Vector search still earns its place for large unstructured prose corpora, for fuzzy recall where users never type the exact term, and for hard single-lookup latency budgets. Start without one and add it for the questions that actually fail.
Is agentic search slower than RAG?
Yes, per answer. Anthropic states the tradeoff plainly: runtime exploration is slower than retrieving pre-computed data. A RAG lookup is one vector query, while agentic search may take three to six tool calls, and each is a round trip. In exchange you delete the embedding job, the chunk tuning, the vector store and the staleness bugs that come from documents changing without their embeddings changing. If your product tolerates a few seconds, that is usually a good trade. If you are answering inside a live phone call, it is not.
When should I still build a RAG pipeline with embeddings?
Build it when the corpus is genuinely large unstructured prose — years of support transcripts, research papers, regulatory text — where the useful signal is meaning rather than keywords and no filter narrows the field. Build it when users ask in wording that never appears in the source, which is exactly what embeddings are good at. And build it when you have a strict latency budget that only allows one retrieval round trip. Outside those cases you are usually paying pipeline maintenance for a capability plain search already covered.
Can I combine agentic search and vector search in one agent?
Yes, and that is the common production shape. Expose structured lookup and full-text search as first-class tools, then expose semantic search as one more tool the agent may call when the cheap paths come back empty. The agent chooses the order. This keeps the vector index small — you only embed the slice that actually needs meaning-based recall — and it keeps the cheap, exact, auditable path as the default rather than the fallback.
Paying for a retrieval pipeline that isn't earning it?
I build Claude agent systems and n8n automation for teams who need the thing answering correctly in production — including the unglamorous parts: honest retrieval, traces you can read at 2am, and token budgets you can actually see. If you've got an agent that sounds smart and gets specifics wrong, that's usually a retrieval problem with a cheaper fix than you think, and it's a good conversation to have.
Related Posts
AI Agents
Claude Skills vs Subagents: When to Use Each
Claude skills and subagents solve two different problems, and mixing them up is the fastest way to waste context. A skill is reusable instructions loaded into your current conversation — same model, same context, no isolation; it changes how the agent you're already talking to behaves. A subagent is a separate assistant with its own fresh context window, system prompt, tools, and optionally its own model, doing work you never see and returning only a summary. Use a skill for a repeatable procedure that needs the current context — a report format, a QA checklist, a deploy runbook. Use a subagent when you need isolation, parallelism, or context protection: fan out three to five at once, keep a huge read in a throwaway window, run a locked-down reviewer. The strongest setups use both — a skill defines the how, a subagent provides the isolated, parallel where.
AI Agents
Portable SKILL.md: One Skill for Every AI Agent
A skill stays portable when the frontmatter is name plus description and no step names a specific agent's tools. The directories each client reads, the symlink layout I run across 174 skills, and the four things that quietly break it — including the one that was leaking in my own library.
AI Agents
LiteLLM vs OpenRouter: Which LLM Gateway to Run
Managed vs self-hosted, with the real break-even point (~$3,600/mo of model spend), the failover difference that only shows up during an incident, and the prompt-cache mistake that quietly costs ten times the platform fee everyone argues about.