CRAG (Corrective Retrieval-Augmented Generation) adds a grading step between retrieval and generation. A small LLM grader evaluates the relevance of each retrieved document, then triggers correction (e.g., web search) or falls back to the LLM's internal knowledge if all documents are deemed irrelevant.
Corrective Retrieval-Augmented Generation (CRAG) introduces a feedback loop into the RAG pipeline. After retrieving documents, a lightweight LLM grader assesses how relevant each document is to the query. If the grader finds sufficient relevant content, generation proceeds normally. If not, CRAG can trigger a correction action: rewriting the query, performing a web search, or using the LLM's parametric knowledge as a fallback. This prevents hallucination when retrieval fails.[reference:8][reference:9]
Rewrite Query: Use an LLM to reformulate the query and re‑retrieve.
Web Search Fallback: Call an external search API (e.g., Tavily, Google) to fetch additional context.
Parametric Knowledge: Rely on the LLM's internal training data when no relevant documents are found.
Confidence Thresholds: Tune grader thresholds to balance precision and recall.