Diagram comparing a classic RAG pipeline of chunking, embedding and top-k search with an agent that searches, reads and reasons over sources directly
Back to Work & InsightsComprehensive Guide

Why Everyone Built RAG, and Why Many Teams Are Moving On

Retrieval-Augmented Generation was the default way to give an LLM your data. Long context, prompt caching, and agentic search changed the math. Retrieval isn't dead, but the classic chunk-embed-top-k pipeline no longer has to be your first move.

TL;DR

  • RAG took off because early models had small context windows (4K to 32K tokens), expensive tokens, and no knowledge of your private data. Retrieving a few relevant chunks was the only practical option.
  • In production, the classic pipeline proved fragile: chunking breaks documents apart, embedding similarity is not the same as relevance, and every stage (chunk size, embeddings, top-k, reranker) needs tuning and re-indexing.
  • Three shifts reduced the need for it: context windows of hundreds of thousands to millions of tokens, prompt caching that makes reusing a large context cheap, and models that reliably use tools to search, open files, and query databases themselves.
  • What remains is retrieval as a tool, not a pipeline. Put the corpus in context when it fits; let an agent search when it doesn't; keep vector search for very large corpora, strict latency budgets, or very high volume.
Knowledge access · Typical API wrapper

Chunk everything, embed it, stuff the top-k chunks into the prompt

Knowledge access · FDE architecture

Full context when it fits, agentic search when it doesn't, vector retrieval only where scale demands it

01 · History

Why RAG became the default

In 2023 the problem was simple to state: the model knows nothing about your company, and you can only show it a few pages at a time. RAG solved both.

Tiny context windows
4K–32K tokens ≈ 6–50 pages

A product manual or contract set didn't fit. Something had to choose which few paragraphs the model would see.

Expensive tokens
re-sending the docs on every call

Even when documents fit, paying to send all of them on every request was too costly. Sending five chunks was far cheaper.

Knowledge cutoff & private data
“What's our refund policy?”

Models were trained on public data up to a fixed date. Retrieval was the cheapest way to add fresh or internal knowledge without fine-tuning.

Grounding & citations
answer + [source: policy.pdf p.4]

Answering from retrieved text reduced hallucination and let users check the source. Compliance teams liked that.

The recipe was easy to demo: split documents into chunks of a few hundred tokens, turn each chunk into an embedding vector, store the vectors in a vector database, and at question time pull the top few most similar chunks into the prompt. Frameworks and vector databases made it a weekend project, so it became the default architecture for 'chat with your data'.

02 · Failure modes

Where classic RAG fails in production

The demo worked on ten documents. Real corpora and real questions exposed the weak points.

Chunking destroys context

A clause says “the above exclusions do not apply in California”. The chunk that holds it doesn't include the exclusions.

Give the model whole documents or sections, or let it open the surrounding text when it needs more.

Similar is not relevant

“What did we decide about pricing?” retrieves every chunk that mentions pricing, but not the meeting note that holds the decision.

Combine keyword search, metadata filters, and multi-step lookups, so the model can refine its search like a person would.

One shot, no retry

Top-k returns the wrong chunks, and the model answers confidently from them anyway.

Let the model see what it found, decide it isn't enough, and search again with a better query.

Questions across the whole corpus

“Which contracts renew this quarter?” needs every contract. Five chunks can't answer it.

Use structured queries (SQL, metadata) for aggregate questions, or put the whole set in context.

Pipeline maintenance

Chunk size, overlap, embedding model, top-k, and reranker all interact. Changing the embedding model means re-indexing everything.

Fewer moving parts: search tools over the source of truth, so there is no separate index to keep in sync.

Stale and leaky indexes

The vector store is a copy. It lags behind edits and ignores the source system's permissions.

Query live systems through connectors (for example MCP servers) that enforce the user's own permissions.

03 · The shift

Three shifts that changed the math

Long context
Frontier models now accept hundreds of thousands to a million or more tokens, enough for a full code repository, a data room, or years of support docs. Their ability to find and use facts deep inside long inputs has also improved a lot.
Prompt caching
Providers cache the processed prefix of a prompt and charge a fraction of the normal input price to reuse it, with lower latency too. A large, stable knowledge base can sit in the prompt across many requests without paying full price each time.
Agentic search
Models now reliably call tools: run a search, grep a folder, open a file, query a database, follow a link, and repeat until they have enough. Coding agents such as Claude Code navigate large codebases this way, without a vector index.
“Does our enterprise contract with Acme allow us to subcontract data processing?”
Classic RAG
One retrieval, then hope
  1. 01Embed the question
  2. 02Pull the top 5 chunks that mention “subcontract” or “data processing”
  3. 03Miss the amendment that changed clause 9.2
  4. 04Answer confidently from the original clause
Agentic retrieval
Search, read, check, repeat
  1. 01Search the contract system for Acme agreements
  2. 02Open the master agreement and read the whole clause 9
  3. 03Notice the reference to Amendment 2, then search for it and read it
  4. 04Answer from the amended clause, citing both documents

The agentic path makes more model calls and takes longer. You pay that for questions where a missed document is expensive.

04 · Decision

Do you still need a vector RAG pipeline?

Your score: 0 / 6

Skip the pipeline

Put the documents in context with prompt caching, or give the model search and read tools over the source systems. Fewer moving parts and better answers on hard questions.

05 · Trade-off

What each approach costs

Full context
Simplest and best for reasoning across documents. Cost and latency grow with context size, so it depends on caching and works only while the corpus fits.
Agentic search
Handles multi-step questions and uses live data and permissions. Several tool calls per answer mean more latency, more tokens, and behavior that is harder to predict, so it needs evals and step limits.
Classic vector RAG
Fast and cheap per query at large scale. In exchange you maintain an index, tune chunking and ranking, and accept that some questions fall through the gaps.

“RAG is dead” is too strong. Retrieval is still how a model reaches knowledge it wasn't trained on. What changed is who drives it: instead of a fixed pipeline choosing five chunks before the model sees the question, the model chooses what to look at, as many times as it needs.

06 · Playbook

How to choose for a new project

  1. 01Measure the corpus in tokens. If it fits comfortably in context, start with full context and prompt caching.
  2. 02Write 30 to 50 real questions with known answers, including multi-document and aggregate ones, as your eval set.
  3. 03If it doesn't fit, give the model search and read tools over the source systems before building any index.
  4. 04Add a vector index only where evals show keyword and structured search missing meaning-based matches.
  5. 05Keep permissions at the source: query live systems as the user instead of copying data into a shared store.
  6. 06Track answer accuracy, cost, and latency per approach, and re-test when models or context prices change.

Tooling options

Large, stable context
Prompt caching

Offered by Anthropic, OpenAI, and Google. Reuse a big prefix of documents across calls at a discount.

Live connectors
MCP servers

Expose search and read tools over Drive, Notion, databases, and internal APIs, with the source's own permissions.

Hybrid search
Postgres full-text + pgvector

Keyword and vector search next to data you already run. Usually enough before a dedicated vector database.

Retrieval quality
Rerankers

Cross-encoder rerankers (for example Cohere Rerank) reorder candidates when you do run a retrieval pipeline.

More guides

Want this built into your workflow?

I help small and mid-size teams decide what to build, then build it, from the first eval set to production guardrails.

Talk through your use case