Inferensys

Glossary

Corrective RAG (CRAG)

An agentic RAG architecture that implements a self-correcting loop, where a retrieval evaluator assesses the quality of fetched documents and triggers web searches or knowledge refinement if they are irrelevant.
Developer working on RAG retrieval system, document chunks visible on screen, technical workspace with code editor.
DEFINITION

What is Corrective RAG (CRAG)?

Corrective RAG (CRAG) is an agentic Retrieval-Augmented Generation architecture that implements a self-correcting loop to evaluate the quality of retrieved documents and automatically trigger corrective actions, such as web searches, when the initial retrieval is irrelevant.

Corrective RAG (CRAG) is a plug-and-play RAG strategy that introduces a lightweight retrieval evaluator to assess the relevance of fetched documents before generation. Unlike static RAG, which blindly feeds all retrieved context to the LLM, CRAG classifies documents into Correct, Incorrect, or Ambiguous confidence tiers. This classification dynamically triggers downstream actions: highly relevant documents proceed directly to generation, while irrelevant results are discarded in favor of a web search fallback to source external knowledge.

For ambiguous documents, CRAG employs a knowledge refinement step, decomposing the text into fine-grained knowledge strips, filtering noise, and recombining only the factual segments. This self-correcting loop transforms RAG from a passive retrieval system into an active, agentic architecture that autonomously verifies and improves its own grounding context, significantly reducing hallucination rates on complex or knowledge-intensive queries.

ARCHITECTURAL COMPONENTS

Key Features of CRAG

Corrective RAG implements a self-correcting loop that evaluates retrieval quality and triggers corrective actions when documents are irrelevant.

01

Retrieval Evaluator

A lightweight classifier that assesses the relevance of each fetched document against the user query. It assigns a confidence score to every retrieved passage, categorizing them as correct, ambiguous, or incorrect. This evaluation gate determines whether the retrieved context is sufficient for generation or requires correction. The evaluator is typically fine-tuned on a dataset of query-document pairs labeled for relevance, enabling it to detect subtle mismatches that would otherwise lead to hallucination.

02

Knowledge Refinement

When documents are flagged as ambiguous, CRAG triggers a targeted decomposition step. The query is broken into sub-queries and re-executed against the knowledge base. Retrieved passages are then segmented into granular knowledge strips, and the evaluator re-scores each strip. Only strips that pass the relevance threshold are retained, effectively filtering noise from partially relevant documents and extracting the precise factual nuggets needed for grounding.

03

Web Search Fallback

If the evaluator classifies all retrieved documents as incorrect or irrelevant, CRAG abandons the internal knowledge base entirely. It triggers an external web search via a search API, treating the open web as a supplementary knowledge source. The retrieved web results are then fed into the knowledge refinement pipeline for strip-level evaluation. This ensures the system never generates from poor context, gracefully degrading to broader search when proprietary data is insufficient.

04

Self-Correcting Loop

The architecture operates as a closed feedback loop rather than a linear pipeline. After any corrective action—refinement or web search—the evaluator re-assesses the new context. This iterative cycle continues until sufficient high-confidence knowledge strips are assembled. The loop design prevents cascading errors by ensuring that only verified, relevant information reaches the generation phase, making CRAG inherently more robust than static retrieve-then-generate architectures.

05

Arbitration Logic

A deterministic arbitration layer governs the transition between CRAG's operational modes. It consumes the evaluator's confidence scores and enforces a rule-based policy:

  • Correct documents → proceed directly to generation
  • Ambiguous documents → trigger knowledge refinement
  • Incorrect documents → trigger web search fallback This explicit control flow makes the system's behavior auditable and predictable, unlike implicit model-based routing.
ARCHITECTURAL COMPARISON

CRAG vs. Standard RAG vs. Self-RAG

A feature-level comparison of three retrieval-augmented generation paradigms, highlighting differences in retrieval evaluation, self-correction mechanisms, and adaptive behavior.

FeatureStandard RAGSelf-RAGCRAG

Retrieval Trigger

Always retrieves before generation

Adaptive; retrieves on-demand per token

Always retrieves; evaluates post-hoc

Retrieval Evaluator

Self-Correction Loop

External Web Search Fallback

Knowledge Refinement Step

On-Demand Retrieval

Reflection Tokens

Primary Hallucination Mitigation

Static context grounding

Critique & selective generation

Iterative document quality assessment

CORRECTIVE RAG EXPLAINED

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the self-correcting retrieval architecture known as Corrective RAG (CRAG).

Corrective RAG (CRAG) is an agentic RAG architecture that implements a self-correcting loop to improve the factual grounding of a language model's output. It works by introducing a Retrieval Evaluator component that assesses the quality of documents fetched from a knowledge base before they are used for generation. If the evaluator deems the retrieved documents irrelevant or unhelpful for the user's query, CRAG dynamically triggers a corrective action, such as a fallback to a broader web search or knowledge graph refinement. This ensures the model only synthesizes an answer from high-confidence, relevant context, directly addressing the 'garbage in, garbage out' problem in standard RAG pipelines.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.