All RAG types

  • Intermediate
  • 35 min
  • Lesson 4 of 6 in Retrieval-augmented generation
  • Last verified

Before you start

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.

Diagram: Starting from a hybrid-plus-rerank baseline, you ask what kind of failure you see (exact-ID misses, phrasing gaps, missing context,...

Yes

No

Yes

No

Yes

No

Yes

No

Yes

No

Yes

No

Start: hybrid + rerank baseline

Failures are
exact-ID misses?

Tune hybrid / BM25 weights

Query and doc
phrasing differ?

Query rewrite / HyDE

Answers need
surrounding context?

Parent-child / sentence window

Multi-hop or
corpus-wide questions?

GraphRAG / iterative retrieval

Retrieval often
irrelevant or empty?

Corrective RAG: grade + fallback

Mixed query
complexity and cost?

Adaptive routing

Agentic RAG only if tools / multi-step needed

Diagram summary: Starting from a hybrid-plus-rerank baseline, you ask what kind of failure you see (exact-ID misses, phrasing gaps, missing context, multi-hop questions, empty retrieval, mixed difficulty) and the first “yes” suggests the matching variant. Agentic RAGAgentic RAGA RAG design in which the model decides whether, what and how often to retrieve. It needs step limits, tracing and guardrails, and its cost and latency vary.Open the glossary entry is the last resort.

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.

Diagram: The agent plans, picks one of several tools (vector search, SQL or API, web search), observes the result, and loops back until it can give...

User question

Agent
plan + decide

Vector search

SQL / API

Web search

Observe results

Final grounded answer

Diagram summary: The agent plans, picks one of several tools (vector search, SQL or API, web search), observes the result, and loops back until it can give a final grounded answer.

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.

Diagram: The query matches small child chunks, the system looks up each child’s parent section, and the model reads the larger parent text.

Query

Match small child chunks

Look up parent section

LLM sees full parent context

Diagram summary: The query matches small child chunks, the system looks up each child’s parent section, and the model reads the larger parent text.

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).

Diagram: Retrieved documents are graded.

Good

Ambiguous

Bad

Retrieve

Grade relevance

Generate

Refine + add web

Rewrite + web search

Diagram summary: Retrieved documents are graded. Good ones go straight to generation, ambiguous ones are refined and supplemented with web results, and bad ones trigger a rewrite and a web search before generation.

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

TypeFixesAdded costMain risk
AdvancedPrecision, recallOne or two extra stagesLatency
HybridExact-token missesSecond indexFusion tuning
HyDEPhrasing gapOne more LLM callBiased retrieval
Parent-childMissing contextLarger promptToken cost
GraphRAGMulti-hop and corpus-wide questionsHeavy indexingStaleness, extraction errors
CRAGBad retrievalA graderGrader errors
AdaptiveCost on easy queriesA routerMisrouting
Self-RAGUnneeded retrievalA specially trained modelTraining dependency
AgenticMulti-step, multi-sourceMany callsLoops, unpredictability
MultimodalNon-text contentStorage, parsingParsing 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.

  1. Do. Answer the five drills below on paper before reading the worked answers. For each, name the failure you expect and the variant.
  2. Notice. Compare with the worked answers. Where did you reach for a heavier variant than the failure needed?
  3. 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

  1. Legal contracts, clause-level questions with section cross-references.
  2. “Summarise the main themes across 10,000 support tickets.”
  3. A product catalogue with SKUs and natural-language questions.
  4. An internal HR bot where most queries are simple FAQs.
  5. Financial reports with charts and tables.

Worked answers

  1. Parent-child retrieval with structure-aware chunking, plus rerank. Cost: bigger prompts. Risk: cross-references that span sections may still be missed.
  2. 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.
  3. Hybrid search with metadata filters, because SKUs are exact tokens. Cost: second index. Risk: fusion tuning.
  4. Adaptive routing plus caching, so easy questions skip the expensive path. Risk: misrouting hard questions.
  5. 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.”

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.

0 of 9 answered

Keyboard: arrow keys move between options. Space or Enter selects the focused option.

ObjectiveState the decision rule (simple baseline, measure, add complexity only for a named failure) and walk the decision tree.

  1. Question 1 of 9A new RAG assistant gives mediocre answers. What does the decision rule recommend as the first move?

    Choose one answer.

  2. Question 2 of 9On a labelled set, most failures are queries containing exact part numbers that dense retrieval misses, while paraphrased questions work. Following the decision tree, what do you do?

    Choose one answer.

ObjectiveDescribe when naive, advanced, modular and agentic RAG each earn their place and what each costs.

  1. Question 3 of 9A company's assistant answers 30 predictable questions about opening hours and delivery from one document set. Which design is most appropriate?

    Choose one answer.

  2. Question 4 of 9What distinguishes modular RAG from advanced RAG?

    Choose one answer.

ObjectiveMatch HyDE, parent-child, GraphRAG, Self-RAG, Corrective RAG and Adaptive RAG to the failure each one fixes and its main risk.

  1. Question 5 of 9A team adopts HyDE and finds it sometimes steers search toward a plausible but wrong topic. What is the mechanism?

    Choose one answer.

  2. Question 6 of 9An engineer proposes adding Self-RAG by adding a 'critique yourself' step to the system prompt. What is wrong with that plan?

    Choose one answer.

  3. Question 7 of 9Retrieval often returns pages that are irrelevant or nothing at all, and the system answers anyway. Which variant addresses this directly, and what is its cost?

    Choose one answer.

ObjectivePick a RAG variant for a described scenario and defend the choice with its cost and failure mode.

  1. Question 8 of 9A product manager asks: 'Summarise the main themes across 10,000 support tickets.' Why does plain top-k similarity RAG struggle, and what fits better?

    Choose one answer.

  2. Question 9 of 9Three queries arrive at once: (1) the platform for ticket TK-4471, (2) what changed across the whole line this week, (3) when the 21:40 leaves. Which assignment is most sensible?

    Choose one answer.