Beyond vector search: how RAG actually works in 2026
RAG stopped being "vector database plus a language model" a while ago. Here's how retrieval-augmented generation actually works now — chunking, embeddings, reranking, knowledge graphs, and agentic retrieval — and where each piece quietly breaks.
Ask most people how retrieval-augmented generation works and you'll get a two-part answer: put your documents in a vector database, and let the language model search them at query time. That description was accurate around 2023. It is now roughly the "cars have four wheels and an engine" of RAG — true, and missing everything that determines whether the thing actually works.
The gap between that mental model and a production retrieval system is where most RAG projects quietly fail. A system built on the two-part story retrieves plausible-looking passages, feeds them to a capable model, and still returns answers that are subtly wrong, confidently unsupported, or missing the one document that mattered. The model gets blamed. The model is rarely the problem. The problem is almost always somewhere in the retrieval pipeline that the two-part story doesn't mention.
This is a walk through that pipeline as it actually exists in 2026 — every stage, what it does, and where it breaks. By the end, "RAG" should stop being one word and become the six or seven distinct engineering decisions it really is.
Why retrieval exists at all
Start with the problem RAG solves, because it explains every design choice that follows. A large language model knows what was in its training data, frozen at a cutoff date, blended into its weights in a way nobody can edit. It cannot cite where a fact came from, cannot be updated without retraining, and when asked something outside its knowledge it does not reliably say "I don't know" — it produces a fluent, plausible answer anyway. That last behaviour is hallucination, and it is not a bug you can prompt away; it is what a next-token predictor does when the tokens it needs aren't in its parameters.
Retrieval-augmented generation is the architectural answer. Instead of relying on the model's frozen memory, you fetch relevant documents at query time and put them into the model's context window alongside the question, so the model answers from text you supplied rather than from its parameters. Done well, this gives you three things the bare model can't: current knowledge (update the documents, not the weights), attribution (the answer traces to a passage you can show), and control (the model works from your corpus, not the open internet).
The whole discipline of RAG is making that fetch reliable. Because if the retrieval step hands the model the wrong passages — or the right passages buried among wrong ones, or no useful passage at all — then all three benefits collapse and you're back to a fluent model guessing, now with extra infrastructure. Retrieval quality is the ceiling on the entire system. This is the single most important fact about RAG and the one the two-part story omits.
Stage one: chunking, the decision everyone underestimates
Before anything can be retrieved, your documents have to be broken into pieces. This is chunking, and it is the most consequential boring decision in the pipeline — the one teams spend the least time on and regret the most.
The reason chunks exist is mechanical: you retrieve and embed units of text, and a whole 40-page document is too coarse a unit. If a user asks a specific question, you want to retrieve the specific paragraph that answers it, not the entire report it lives in. So documents get split. But how you split determines what can ever be retrieved, and the naive approaches sabotage everything downstream.
Split by a fixed number of characters and you'll cut sentences in half, sever a claim from its evidence, and orphan a table from its header. Split too small and each chunk loses the context that made it meaningful — a paragraph that says "this approach failed for three reasons" is useless when the reasons were in the previous chunk. Split too large and each chunk contains several topics, so its embedding becomes a blurry average that matches everything vaguely and nothing precisely. There is a genuine tension here: small chunks are precise but context-poor; large chunks are context-rich but imprecise, and no single size is right for every corpus.
The 2026 practice has moved past fixed-size splitting toward structure-aware chunking — splitting on semantic and document boundaries (sections, paragraphs, logical units) rather than character counts, so each chunk is a coherent thought. Techniques like late chunking (embedding a longer passage first, then pooling into chunk representations so each chunk's embedding still carries surrounding context) directly attack the context-versus-precision tension. But the deeper lesson is diagnostic: if your RAG system can't answer a question whose answer is definitely in your corpus, suspect chunking first. The passage may have been split so the answer never lives in any single retrievable unit.
Stage two: embeddings and the vector database
Once you have chunks, each one gets converted into a vector — a list of numbers that positions the chunk in a high-dimensional space where semantically similar text lands nearby. These are embeddings, and they're what makes meaning-based search possible: "how do I reset my password" and "steps to recover account access" share almost no words but sit close together in embedding space because they mean nearly the same thing.
Those vectors are stored in a vector database, which exists to do one thing quickly: given a query vector, find the stored chunk vectors nearest to it, fast, across millions of entries. This is the piece the two-part story treats as the whole of RAG, and it is genuinely important infrastructure — but notice it's stage two of many, and it's doing something narrower than "search." It's doing vector search: nearest-neighbour lookup in embedding space, which is what powers semantic search.
Here's what the vector-database-centric view misses. Vector search finds text that is semantically similar to the query, and semantic similarity is not the same as relevance. A passage can be about the same topic as the question without containing the answer. Vector search will happily return five paragraphs that are all "about" the query and none of which actually answer it. It also famously struggles with the things keyword search is good at: exact terms, product codes, names, acronyms, negations. Ask for error code "E-4041" and pure vector search may return passages about error handling generally, because the specific code isn't semantically distinctive — it's a lexical needle that embeddings smooth over.
This is why 2026 production systems rarely rely on vector search alone. They use hybrid search — combining vector similarity with old-fashioned keyword (lexical) search — so exact terms are caught by the keyword side and semantic matches by the vector side. The vector database is necessary. It was never sufficient.
Stage three: reranking, where quality is actually won
Say retrieval returns the twenty chunks most similar to the query. Which of those twenty actually belong in the model's context — and in what order? This is reranking, and it's the stage that most separates a mediocre RAG system from a good one, precisely because the two-part story skips it entirely.
The reason reranking exists is a speed-versus-accuracy trade built into retrieval. The first-pass search (vector or hybrid) has to be fast because it scans the whole corpus, so it uses a cheap similarity measure — comparing the query embedding to each chunk embedding independently. That's fast but crude: the query and the chunk were embedded separately, so the score never actually considers them together. A reranker fixes this by taking the top candidates from the fast pass and scoring each one against the query jointly — reading query and chunk as a pair and judging genuine relevance, not just vector proximity. This is far more accurate and far too slow to run over a whole corpus, which is exactly why it runs second, over a shortlist.
The payoff is large and under-appreciated. A first-pass retrieval that puts the right answer at rank 8 is nearly useless if you only feed the model the top 5 chunks — the answer never arrives. A good reranker promotes that rank-8 passage to rank 1, and the same downstream model suddenly "gets smarter" — except the model didn't change; the right context finally reached it. When a RAG system retrieves the correct passage but ranks it below the cutoff, reranking is the fix, and teams that skip it are leaving most of their achievable quality unclaimed.
Stage four: what actually goes in the context
Now you have a ranked set of relevant chunks. What you do with them — how many you include, in what order, with what surrounding instruction — is context engineering, and it's a real discipline, not an afterthought of pasting text into a prompt.
Several non-obvious effects govern this stage. Models attend unevenly across a long context — information at the very start and very end is used more reliably than material buried in the middle, the "lost in the middle" effect — so the order in which you place retrieved chunks matters, and putting your best passage in the middle of twenty others can bury it. More context is not automatically better: past a point, adding chunks dilutes the signal, raises cost and latency, and can degrade the model's use of what's actually relevant, a phenomenon practitioners call context rot. And the instruction wrapped around the retrieved text — telling the model to answer only from the provided passages and to say when they're insufficient — is what stands between a grounded answer and the model quietly reverting to its parameters when the passages don't quite cover the question.
The goal of this stage is not to maximise the information in front of the model. It's to give the model the smallest set of genuinely relevant, well-ordered passages that answers the question — and a clear instruction about what to do when they don't.
The limits of the vector-search story — and what replaced it
Everything so far still assumes retrieval means "find chunks similar to the query." That assumption itself is what 2026 moved past, in two directions.
Knowledge graphs. Vector search treats your corpus as a bag of independent chunks with no relationships between them. But real knowledge has structure — this person works at that company, this drug interacts with that one, this clause depends on that definition — and questions that require connecting facts across documents are exactly what chunk-similarity retrieval fails at. Ask "which of our suppliers are affected by the new regulation, and who owns them?" and no single chunk contains the answer; it has to be assembled across several. This is where the knowledge graph comes in: representing entities and their relationships explicitly, so retrieval can traverse connections rather than only match similarity.
GraphRAG — retrieval that draws on a knowledge graph, often built from the corpus itself — is one of the most significant shifts in the field. It handles the multi-hop, relationship-heavy questions that defeat pure vector search, and it handles "global" questions about a whole corpus ("what are the main themes across these thousand documents?") that no local chunk retrieval can answer. It's not a replacement for vector search — it's a different tool for a different question shape, and mature systems increasingly combine both: vectors for "find me passages like this," graphs for "trace how these things connect."
Agentic retrieval. The second shift dissolves the assumption that retrieval is a single step at all. In classic RAG, the pipeline is fixed: one query in, one retrieval pass, one generation out. Agentic RAG turns retrieval into a loop driven by the model's own judgment. The system can decide what to search for, evaluate whether what it found is sufficient, reformulate the query and search again, break a complex question into sub-questions and retrieve for each, and cross-check sources before answering. Retrieval stops being a fixed function and becomes a strategy the model plans and adjusts — which is precisely what happens when you give an AI agent retrieval as one of its tools.
This is where RAG and agents meet, and why the two topics are converging in 2026. A single-pass RAG system asks "what's similar to this query?" once and lives with the answer. An agentic retrieval system asks "do I have what I need yet?" repeatedly, and keeps working until the answer is yes or it has honestly established that the corpus can't answer. The cost is complexity, latency, and every failure mode that comes with giving a model autonomy over a loop — but for questions where a single retrieval pass was never going to be enough, it's the difference between "here's a plausible guess" and "here's an answer I actually assembled."
The pipeline as a diagnosis table
Because each stage fails in its own recognisable way, a misbehaving RAG system can usually be diagnosed from the symptom rather than guessed at. This is the table worth keeping next to a struggling pipeline:
| Symptom | Likely stage at fault | The fix |
|---|---|---|
| Answer is definitely in the corpus but never retrieved | Chunking severed it across units | Structure-aware chunking; check the answer lives in one chunk |
| Exact terms, codes, or names aren't found | Pure vector search smooths over lexical needles | Add keyword search — hybrid retrieval |
| Right passage retrieved but answer still wrong | It ranked below the cutoff and never reached the model | Add or improve a reranker |
| Retrieved passages are all "about" the topic, none answer it | Semantic similarity mistaken for relevance | Reranking, and tighter chunking |
| Model ignores a passage that's clearly present | Lost in the middle — buried in a long context | Reorder: best passages first and last; include fewer |
| Answers drift back to generic model knowledge | Weak grounding instruction, or passages don't cover it | Instruct answer-only-from-context; detect insufficiency |
| Multi-fact questions fail ("which X relate to Y?") | Chunk retrieval can't connect facts across documents | Knowledge graph / GraphRAG |
| Complex questions need info the first search missed | Single-pass retrieval was never enough | Agentic retrieval — plan, evaluate, search again |
The pattern across the table is the point: only one row ("answers drift back to generic knowledge," partly) has anything to do with the model itself. Every other failure is a retrieval-stage problem with a retrieval-stage fix. This is why reaching for a bigger model is so often the wrong move — it addresses the one row that's least commonly the actual cause.
Putting the pipeline back together
Step back and RAG in 2026 is not a component. It's a pipeline of decisions, each of which can independently sink the whole:
Documents are chunked into coherent units — get this wrong and the answer never lives in any retrievable piece. Chunks are embedded and stored for fast vector search, usually alongside keyword search as hybrid search — so both semantic matches and exact terms are caught. First-pass candidates are reranked by a model that judges query and passage together — where most achievable quality is won or lost. The best passages are assembled through context engineering — the right few, well-ordered, with an instruction to stay grounded. And increasingly, the whole loop is either enriched by a knowledge graph for relationship-heavy questions, or driven by an agent that plans retrieval across multiple passes.
The reason "vector database plus a language model" is a dangerous mental model is that it makes the vector database the whole story, when it's one stage of six or seven — and rarely the one that's actually failing. When a RAG system underperforms, the instinct is to reach for a bigger model. The evidence almost always points elsewhere: to chunks that severed the answer, to a first pass that never surfaced the right passage, to a missing reranker that left it below the cutoff, to a context so bloated the model couldn't use it, or to a question whose shape needed a graph or a second retrieval pass and got neither.
RAG works — extraordinarily well — when each of those stages is treated as the real engineering decision it is. It disappoints when it's treated as two parts. The systems that deliver in 2026 aren't the ones with the fanciest model. They're the ones whose builders understood that "retrieval" was never one thing, and engineered every stage of it.
Common questions
What is RAG in simple terms? Retrieval-augmented generation is a technique where, instead of relying on a language model's frozen training knowledge, you fetch relevant documents at query time and place them in the model's context so it answers from text you supplied. This gives current knowledge, source attribution, and control over what the model draws on — none of which the bare model offers.
Why does my RAG system give wrong answers even with a strong model? Almost always because retrieval failed, not the model. The right passage may have been split badly during chunking, missed by the first-pass search, ranked below your cutoff because there's no reranker, or buried in an over-stuffed context. A stronger model can't answer from a passage it never received — retrieval quality is the ceiling on the whole system.
Is a vector database all I need for RAG? No — and this is the most common misconception. A vector database does fast nearest-neighbour search in embedding space, which is one stage of a pipeline that also includes chunking, keyword search (for exact terms vectors miss), reranking, and context engineering. Vector search finds semantically similar text, which is not the same as text that actually answers the question.
What is the difference between RAG and GraphRAG? Standard RAG retrieves chunks similar to the query — good for "find me passages like this." GraphRAG uses a knowledge graph of entities and their relationships, so it can answer questions that require connecting facts across documents or reasoning about a whole corpus — "which suppliers are affected and who owns them?" — that chunk-similarity retrieval fails at. Mature systems often use both.
What is agentic RAG? Agentic RAG turns retrieval from a single fixed step into a loop the model controls: it decides what to search for, judges whether the results are sufficient, reformulates and searches again, breaks complex questions into sub-questions, and cross-checks sources before answering. It's what happens when retrieval becomes one of an AI agent's tools rather than a one-shot function — more capable on hard questions, at the cost of complexity and latency.
What's the single highest-leverage part of a RAG pipeline to improve? For most underperforming systems, adding or improving a reranker. The first-pass search is fast but crude — it scores query and chunk separately. A reranker reads them together and promotes the genuinely relevant passage that the fast pass left ranked too low to reach the model. It's often the largest quality gain available without touching the model or the data.
Sources & further reading
The primary literature behind the claims above, drawn from the concept entries this post links to — so a claim carries the same source here as it does there.
- Brown et al. (2020), Language Models are Few-Shot Learners — GPT-3, and the demonstration that scale alone changes what models can do. :: https://arxiv.org/abs/2005.14165 Large Language Model (LLM)
- Kaplan et al. (2020), Scaling Laws for Neural Language Models, and Hoffmann et al. (2022), Training Compute-Optimal Large Language Models — the second corrected the first on how to spend a compute budget. :: https://arxiv.org/abs/2001.08361 Large Language Model (LLM)
- Ouyang et al. (2022), Training language models to follow instructions with human feedback — InstructGPT, the step that turned a text predictor into something usable. :: https://arxiv.org/abs/2203.02155 Large Language Model (LLM)
- Ji et al. (2022), Survey of Hallucination in Natural Language Generation — the taxonomy worth having before you use the word. Hallucination
- Maynez et al. (2020), On Faithfulness and Factuality in Abstractive Summarization — hallucination measured on a task where the source text was right there. Hallucination
- Bender et al. (2021), On the Dangers of Stochastic Parrots — the argument that fluency without grounding is the design, not the bug. Hallucination
- Liu et al. (2023), Lost in the Middle: How Language Models Use Long Contexts — models use the beginning and end more reliably than the middle. :: https://arxiv.org/abs/2307.03172 Context Window
- Press, Smith & Lewis (2022), Train Short, Test Long (ALiBi) — one of the position-encoding tricks that made longer contexts feasible. :: https://arxiv.org/abs/2108.12409 Context Window