All RAG types
- Intermediate
- 35 min
- Lesson 4 of 6 in Retrieval-augmented generation
- Last verified
Select text in the lesson first to keep it with your note. With the keyboard, move focus here and press the button: the note goes with the section you are reading.
In this module
On this page
Before you start
- Completed:Better retrieval
You will be able to
- State the decision rule (simple baseline, measure, add complexity only for a named failure) and walk the decision tree.
- Describe when naive, advanced, modular and agentic RAG each earn their place and what each costs.
- Match HyDE, parent-child, GraphRAG, Self-RAG, Corrective RAG and Adaptive RAG to the failure each one fixes and its main risk.
- Pick a RAG variant for a described scenario and defend the choice with its cost and failure mode.
Three questions reach the Records Car within the same minute. One asks for a platform by ticket number. One asks what changed across the whole line this week. One asks when the 21:40 leaves.
Merrow files and fetches everything the same way: by what a strip is about. He has one method and three very different questions.
Should every question get the same treatment?
Concept
“RAG” is a family of designs, not one design. Each named variant adds a step that fixes a specific failure of the plain pipeline: a query that does not match the documents’ wording, missing surrounding context, questions that span many documents, retrieval that comes back empty, or queries of very different difficulty.
Provenance: common industry patterns. Names and boundaries vary across papers, frameworks and companies.
Why it matters
The common mistake is to build the most elaborate version first. Every extra LLM call adds latency, cost and a new way to fail. In an interview, naming ten variants impresses less than saying which one you would pick for a given failure, and what it would cost.
Mental model
Think of a toolbox, not a ladder. The baseline (hybrid search plus rerank) is a good general tool. Each variant is a specialist tool you reach for only when you can name the job it does, such as “my questions use different words than my documents”.
Decision rule
Say this first in an interview: start with the simplest thing that meets the quality bar, measure, and add complexity only for a failure you can name.
A. Architecture generations
1. Naive RAG. Index, retrieve top-k by similarity, put the chunks in the prompt, generate. Pros: simple, cheap, fast to ship. Cons: low precision, no rewriting or reranking, redundant or irrelevant chunks, fails on multi-hop questions. Good for prototypes and small clean corpora.
2. Advanced RAG. Naive plus pre-retrieval steps (query rewrite, expansion, metadata filters, better chunking) and post-retrieval steps (rerank, de-duplicate, compress). Pros: often a large quality gain for the added complexity. Cons: more moving parts and more latency. This is the usual production baseline.
3. Modular RAG. The pipeline is a set of swappable modules (search, rerank, memory, routing, fusion) wired together by a router, with loops and branches. Pros: flexible, each module can be evaluated alone. Cons: orchestration complexity and harder end-to-end reasoning.
4. Agentic RAG. An LLM agent decides whether to retrieve, which tool or index to use, how to rephrase, and when to stop. It may call vector search, SQL, web search or other APIs.
Pros: handles multi-step questions over mixed sources. Cons: unpredictable latency and cost, possible loops, and harder to evaluate and secure. It needs step limits, tracing and guardrails (see Agentic patterns).
B. Retrieval-side variants
5. Hybrid RAG. BM25 plus dense with RRF. Best when queries contain exact identifiers or domain jargon.
6. HyDEHyDEHypothetical document embeddings: the model writes a plausible answer and that text is used to search. It helps when queries and documents are phrased differently, but a wrong draft can bias retrieval.Open the glossary entry (Hypothetical Document Embeddings). An LLM writes a plausible answer and you embed that to search. It bridges question-versus-document phrasing. Cost: an extra call, and a wrong hypothetical answer can bias retrieval toward the wrong idea.
7. Parent-child (small-to-big). Embed small chunks, return the parent section.
Pros: precise matching with rich context. Cons: larger prompts, and parents shared by several children must be de-duplicated.
8. GraphRAGGraphRAGA RAG variant that builds a graph of entities and relations from the corpus. It suits corpus-wide (global) questions and multi-hop ones, with costly indexing and a graph that can go stale.Open the glossary entry. Extract entities and relations into a knowledge graph (often with summaries of communities of related entities), then retrieve by traversal or by those summaries. It helps with multi-hop questions and “summarise the whole corpus” questions that similarity search handles poorly (Edge et al., 2024). Cons: indexing is expensive (many LLM calls), the graph can go stale, and extraction errors propagate.
9. Iterative or multi-hop RAG. Retrieve, reason, form a new sub-query, retrieve again until there is enough evidence. Cons: latency, and it needs a stop rule.
C. Control-loop variants
10. Self-RAGSelf-RAGA RAG variant in which a specially trained model emits reflection tokens that decide whether to retrieve and judge whether passages are relevant and its answer is supported. It cannot be added to an ordinary model with a prompt.Open the glossary entry. The model is trained to emit reflection signals: whether to retrieve, whether passages are relevant and supported, whether the output is useful. Pros: retrieves only when needed. Cons: it needs a specially trained model, so it is not a prompt trick you can add to any model (Asai et al., 2023).
11. Corrective RAG (CRAG)Corrective RAG (CRAG)A RAG variant that grades retrieved documents and falls back, for example by rewriting the query or searching the web, when they are weak.Open the glossary entry. A retrieval evaluator scores the retrieved documents. Correct: use them, refined. Ambiguous: refine and supplement. Incorrect: discard and fall back, for example to web search or a rewritten query (Yan et al., 2024).
Cost: the grader adds latency and can itself be wrong.
12. Adaptive RAGAdaptive RAGA RAG variant that routes each query to no retrieval, single-shot retrieval or multi-step retrieval.Open the glossary entry. A classifier or router chooses the strategy per query: no retrieval for simple chat, single-shot RAG, or multi-step for complex questions. Pros: saves cost and latency on easy queries. Cons: router errors send hard queries down the weak path.
D. Data-shape variants
13. Multimodal RAG. Retrieval over images, tables, charts, slides or audio. Either convert to text first (captions, OCR, table-to-text) and run text RAG, or use multimodal embeddings with a vision-capable model. Watch for table structure loss, OCR errors and higher storage and cost.
14. Structured or text-to-SQL RAG. Send questions about numbers and records to SQL or an API and combine them with documents. Guardrails: read-only access, a limited schema, validated queries.
15. Conversational RAG. Rewrite follow-ups into standalone queries, manage memory, and skip retrieval on pure chit-chat.
Comparison table
| Type | Fixes | Added cost | Main risk |
|---|---|---|---|
| Advanced | Precision, recall | One or two extra stages | Latency |
| Hybrid | Exact-token misses | Second index | Fusion tuning |
| HyDE | Phrasing gap | One more LLM call | Biased retrieval |
| Parent-child | Missing context | Larger prompt | Token cost |
| GraphRAG | Multi-hop and corpus-wide questions | Heavy indexing | Staleness, extraction errors |
| CRAG | Bad retrieval | A grader | Grader errors |
| Adaptive | Cost on easy queries | A router | Misrouting |
| Self-RAG | Unneeded retrieval | A specially trained model | Training dependency |
| Agentic | Multi-step, multi-source | Many calls | Loops, unpredictability |
| Multimodal | Non-text content | Storage, parsing | Parsing quality |
Real-world application
Production systems are commonly advanced RAG (hybrid, rerank, filters, citations) with one or two targeted additions chosen from evaluation results. Agentic and graph-based designs show up when the questions demand them, and they come with extra evaluation and security work.
Interview perspective
Provenance: common industry pattern; no company-specific claim.
Open with the decision rule. Then pick the variant for the scenario, name its cost and failure mode, and say how you would measure whether it helped. A typical weak answer lists variants without tying any to a failure.
Practice questions
Provenance: generated practice.
- What does HyDE fix, and how can it backfire?
- Why can you not turn Self-RAG on with a prompt?
- When is agentic RAG the wrong choice?
- Why does top-k similarity search handle “summarise the themes of 10,000 tickets” poorly?
Activity
Do, notice, apply.
- Do. Answer the five drills below on paper before reading the worked answers. For each, name the failure you expect and the variant.
- Notice. Compare with the worked answers. Where did you reach for a heavier variant than the failure needed?
- Apply. Invent a sixth scenario from a product you use. State its likely failure, the simplest fix, and what evidence would make you add something heavier.
Scenario drills
- Legal contracts, clause-level questions with section cross-references.
- “Summarise the main themes across 10,000 support tickets.”
- A product catalogue with SKUs and natural-language questions.
- An internal HR bot where most queries are simple FAQs.
- Financial reports with charts and tables.
Worked answers
- Parent-child retrieval with structure-aware chunking, plus rerank. Cost: bigger prompts. Risk: cross-references that span sections may still be missed.
- GraphRAG or hierarchical summarisation, not plain top-k retrieval, because the answer depends on the whole corpus. Cost: heavy indexing. Risk: stale graph, extraction errors.
- Hybrid search with metadata filters, because SKUs are exact tokens. Cost: second index. Risk: fusion tuning.
- Adaptive routing plus caching, so easy questions skip the expensive path. Risk: misrouting hard questions.
- Multimodal or table-aware parsing. Cost: storage and parsing effort. Risk: table structure loss and OCR errors.
These are defensible starting points, not unique answers. What matters is the stated cost and failure mode.
Homework
Pick one product you have used that answers questions over documents. Write its probable pipeline, its likeliest failure, and one variant from this lesson you would add, with the cost and the metric you would use to prove it helped.
Quick revision
- Simplest thing that meets the bar, measure, add complexity for a named failure.
- Advanced RAG (rewrite, rerank, filters) is the usual production baseline.
- HyDE: phrasing gap, risk of biased retrieval. Parent-child: missing context, larger prompts. GraphRAG: corpus-wide questions, expensive indexing.
- CRAG grades retrieval and falls back. Adaptive routes by difficulty. Self-RAG needs a trained model.
- Agentic RAG: last resort, with step limits and tracing.
Check yourself
- Checkpoint (answer aloud, no notes): Take the five drills and defend each choice with its cost and main failure mode.
- Re-test (nearby variant): A legal team says answers lack context around each clause, but exact clause-number lookups work. Which variant and why?
- Misconception to avoid: “More advanced RAG is always better.”
Related
Practice
Test what you just read. Quizzes and cards are grouped by module: Retrieval-augmented generation.
Check yourself9 questions on what this lesson set out to teach
Checking answers needs JavaScript. You can still read every question and option below.
Keyboard: arrow keys move between options. Space or Enter selects the focused option.