LESSON 39 / 215·2 min readIntermediate

Corrective RAG, self-reflective RAG, and context compression

Should knowConcept lesson
01 Understand02 Recall03 Prepare

Words made simple

A few useful meanings before you read the explanation.

RAG
Find relevant information first, then give it to a model to help answer the question. The answer is only as reliable as the information and checks used.
Retrieval
Finding and fetching information that is useful for the current question.
Evaluation
Checking results against examples and clear criteria to find whether the system works well and where it fails.

Overview

  • Corrective RAG detects inadequate retrieval and applies a correction, such as reformulating search.
  • Self-reflective RAG checks whether evidence or an answer is sufficient and supported.
  • Context compression reduces retrieved text to the parts useful for the current question.

Why this matters

First retrieval may be weak, and bulky evidence can distract the model or exceed budgets.

An everyday example

An employee checks whether the selected page actually answers the question, tries another page once, and highlights relevant lines.

A technical example

If required clause IDs are absent, run one alternative search; preserve exact evidence excerpts rather than summarizing away exceptions.

How it works

  1. Retrieve
  2. Check coverage/support
  3. Apply one bounded correction
  4. Select or compress evidence
  5. Answer
  6. Validate support
  7. Abstain if still insufficient.

Architecture and flow

Retrieve → evidence check → corrective branch → compressed evidence → answer check.

The insurance assistant example

A coverage response fails if it cites a brochure instead of the policy; the workflow retrieves policy wording or escalates.

When to use it

When evaluations show recoverable retrieval failures or context clutter.

When to avoid it

Do not trust model self-approval as proof of correctness or allow compression to remove monetary limits and exceptions.

Interview answer

“These patterns add bounded evidence and answer checks. I measure whether they improve outcomes and use abstention when correction cannot find support.”

Benefits, trade-offs, and production considerations

  • Critic models can repeat the original model's mistake.
  • Prefer extractive compression where possible, preserve source offsets, and independently test the checker's false acceptance rate.
PAUSE & RECALL

Can you explain it without the notes?

Corrective RAG, self-reflective RAG, and context compression

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

Corrective RAG detects inadequate retrieval and applies a correction, such as reformulating search. Self-reflective RAG checks whether evidence or an answer is sufficient and supported. Context compression reduces retrieved text to the parts useful for the…

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Graph RAG

Adapted from 13_AI.MD · “Corrective RAG, self-reflective RAG, and context compression”. Examples are study fragments; framework behavior can depend on your version.