Inferensys

Glossary

Corrective RAG (CRAG)

A self-reflective retrieval-augmented generation architecture that evaluates the relevance of retrieved legal documents and triggers a corrective web search or knowledge graph lookup if the initial retrieval quality is low.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
SELF-REFLECTIVE RETRIEVAL ARCHITECTURE

What is Corrective RAG (CRAG)?

A self-reflective architecture that evaluates the relevance of retrieved legal documents and triggers a corrective web search or knowledge graph lookup if the initial retrieval quality is low.

Corrective RAG (CRAG) is a retrieval-augmented generation architecture that incorporates a dedicated retrieval evaluator to assess the quality of initially fetched documents before generation. The system classifies retrieved legal documents into Correct, Incorrect, or Ambiguous confidence tiers, ensuring that irrelevant or outdated case law does not contaminate the model's context window.

When retrieval quality falls below a confidence threshold, CRAG triggers a corrective action loop—executing a refined web search, querying a structured legal knowledge graph, or reformulating the search with canonical citations. This self-correcting mechanism transforms static RAG pipelines into closed-loop systems capable of knowledge refinement, making it essential for high-stakes legal reasoning where citation integrity is non-negotiable.

Self-Correcting Retrieval Architecture

Key Features of Corrective RAG

Corrective RAG (CRAG) introduces a self-reflective evaluation loop that assesses the quality of retrieved legal documents and triggers corrective actions—such as web search or knowledge graph lookups—when initial retrieval confidence is low.

01

Retrieval Relevance Evaluator

A lightweight classifier or confidence scoring module that assesses the relevance of each retrieved document chunk against the user's legal query. This evaluator acts as a gatekeeper, assigning a confidence score—high, ambiguous, or incorrect—to the initial retrieval set before generation begins. Documents scored as incorrect are discarded entirely, while ambiguous results trigger corrective action. This prevents the language model from hallucinating based on irrelevant or tangentially related case law.

02

Knowledge Graph Fallback

When the retrieval evaluator flags results as ambiguous, CRAG triggers a structured lookup against a legal knowledge graph rather than relying solely on vector similarity. This fallback queries deterministic relationships—such as statutory hierarchies, citation networks, and doctrinal classifications—to inject grounded factual context into the generation prompt. For example, if a query about 'promissory estoppel elements' retrieves only dissenting opinions, the knowledge graph can surface the canonical Restatement section and its interpreting majority holdings.

03

Web Search Augmentation

For queries where the internal legal corpus lacks sufficient coverage, CRAG automatically formulates a corrective web search query. The system extracts key legal terms of art and canonical citations from the original query, executes a search against external legal databases or the open web, and integrates the retrieved content back into the context window. This ensures that even novel or rapidly evolving legal questions—such as recent regulatory changes—receive grounded, current responses rather than outdated or absent internal knowledge.

04

Knowledge Refinement & Filtering

After corrective retrieval, CRAG applies a secondary filtering step to the combined document set—original high-confidence chunks, knowledge graph data, and web search results. This refinement process:

  • De-duplicates redundant information across sources
  • Re-ranks passages by composite relevance and authority scores
  • Segments content into distinct knowledge strips for granular selection Only the most salient, non-redundant passages survive to populate the final generation context, preventing context window bloat and improving citation precision.
05

Self-Reflective Generation Loop

CRAG implements a generate-then-verify cycle where the model's output is scrutinized against the retrieved evidence. If generated claims lack direct support in the provided context, the system can trigger a secondary corrective retrieval pass—reformulating the query based on the model's own reasoning gaps. This recursive loop mirrors a legal associate's process of checking citations and filling logical holes, ensuring that every proposition in the final output is traceable to a specific, verifiable source document.

06

Confidence-Gated Routing

CRAG employs a dynamic routing mechanism that directs queries along different processing paths based on retrieval confidence:

  • High confidence: Direct generation from retrieved documents without corrective action
  • Ambiguous confidence: Knowledge graph augmentation before generation
  • Low confidence: Full corrective web search pipeline This gating optimizes latency and compute cost, reserving expensive corrective operations only for queries where the initial retrieval quality is demonstrably insufficient. The routing decision is logged for observability and audit trails.
CORRECTIVE RAG EXPLAINED

Frequently Asked Questions

Clear, technical answers to the most common questions about self-correcting retrieval-augmented generation architectures for high-stakes legal AI systems.

Corrective RAG (CRAG) is a self-reflective retrieval-augmented generation architecture that evaluates the quality of initially retrieved documents and triggers a corrective fallback—such as a web search or knowledge graph lookup—when the retrieval relevance score falls below a defined confidence threshold. The system operates in a loop: a retrieval evaluator component scores each fetched document chunk for relevance to the query, assigning confidence levels of Correct, Incorrect, or Ambiguous. If the aggregate score is low, CRAG discards the poor results and executes a corrective action. This ensures the language model only conditions its generation on high-quality, grounded evidence. In legal applications, this prevents the model from hallucinating case law based on irrelevant or tangentially related precedents, instead forcing a fresh search for binding authority before generating an answer.

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.