learn

RAG Hallucinations — Troubleshooting Guide

Diagnose unsupported RAG answers by separating retrieval, context construction, model behavior, and evaluation failures.

Troubleshooting

Start with the symptom. End with a verified fix.

What’s wrong?

A RAG application produces answers that are not supported by the retrieved knowledge.

Possible causes

  1. Poor retrieval
  2. irrelevant chunks
  3. missing context
  4. prompt construction issue
  5. model behavior
  6. weak evaluation

Diagnosis

  1. Inspect retrieved documents
  2. compare query and chunks
  3. inspect final context
  4. verify citations
  5. test representative evaluation cases

2 · Fix

Improve the confirmed weak retrieval or generation stage and add explicit grounding behavior where appropriate.

Verify

Re-run a representative evaluation set and inspect both retrieval and final answers.

3 · Prevent

Maintain evaluation cases, retrieval metrics, traces, and regression tests.

RAG Hallucinations

Do not start by changing the model. First inspect the evidence available to it.

Diagnose

Query → retrieval → ranked chunks → final context → generation → answer

Check each stage independently. If the required evidence never reaches the model, generation changes cannot repair the retrieval failure.

Fix → Verify → Prevent

Improve the confirmed weak stage, then verify with a representative evaluation set. Keep regression cases for questions that previously produced unsupported answers.

Engineering companion

Learn → troubleshoot → design → prepare → test

Explore the knowledge graph

Knowledge path

Connected concepts

Explore the knowledge graph