RAG Evaluation: The Four Metrics That Stop the Guesswork

Muskan explains how to grade retrieval and generation separately in a RAG pipeline using recall, precision, answer relevance, and faithfulness.

1:39 video3 min readWatch on YouTube

Your RAG app gave a wrong answer. Was it the retrieval step that pulled the wrong context, or the generation step that misused good context? Without a way to measure each stage separately, fixing that bug turns into guesswork, and guessing which half is broken is how a week gets spent fixing the wrong stage.

Two stages, two failure points

A RAG pipeline has a simple shape: a question goes in, retrieval finds the chunks it thinks are relevant, and generation writes an answer from those chunks. That means there are two distinct places things can go wrong, and the only way to know which one failed is to grade them separately rather than judging the pipeline as a single black box.

Grading retrieval: recall and precision

Retrieval gets graded with two numbers. Recall asks: of all the chunks that were actually relevant to the question, how many did the system retrieve? Miss some of them, and the answer can't possibly be complete, no matter how good the generation step is. Precision asks the opposite question: of the chunks the system did retrieve, how many were actually relevant? Pull in junk alongside the good chunks, and you distract the model with noise. Both numbers require a labeled set of correct answers to compare against.

Grading generation: answer relevance and faithfulness

Once retrieval has been scored, generation gets its own two numbers. Answer relevance asks whether the generated answer actually addresses the question that was asked. Faithfulness asks whether every claim in the answer is backed by the retrieved context, or whether the model invented something that wasn't actually there. These two scores are usually judged by a second model acting as an LLM judge, since they require reading and comparing text rather than counting overlapping items.

Letting the low number point you to the fix

The payoff of grading these four numbers separately is that whichever number drops tells you exactly where to look. Low recall or precision means the context itself was wrong, which points you toward fixing the chunking strategy, the embeddings, or how many chunks you're pulling per query. Low relevance or faithfulness means the context was fine but the answer wasn't, which points you toward fixing the prompt or the model doing the generation. That distinction turns a vague "the RAG app is wrong somewhere" into a specific, actionable diagnosis.

Key takeaways

  • RAG pipelines fail in two distinct stages, retrieval and generation, and each needs its own metrics.
  • Recall measures how many relevant chunks were retrieved; precision measures how many retrieved chunks were actually relevant.
  • Answer relevance measures whether the response addresses the question; faithfulness measures whether every claim is backed by retrieved context.
  • Generation metrics are typically scored by a second model acting as an LLM judge.
  • A low retrieval score points to fixing chunking, embeddings, or retrieval count; a low generation score points to fixing the prompt or model.
  • Run all four metrics on your own RAG pipeline before making any changes, so the low number tells you where to look.

Who this is for

This is for anyone building or maintaining a RAG application who has hit a wrong answer and doesn't know whether the bug is in retrieval or generation. It comes from the Humanitarians AI Fellows program, where Fellows document practical frameworks like this one for debugging real AI pipelines.

Chapters

  1. 0:00Intro: You can’t fix what you don’t measure
  2. 0:15The Two Stages: Distinguishing Retrieval from Generation
  3. 0:30Grading Retrieval: Understanding Recall and Precision
  4. 0:55Grading Generation: Answer Relevance and Faithfulness
  5. 1:15The Payoff: Letting the low number point you to the fix
Full transcript(auto-generated, with timestamps)

Intro: You can’t fix what you don’t measure

[0:00]Hey, I'm Muskin. Your RAG app gave a wrong answer. Was it the retrieval or the generation? You can't fix what you don't measure, and RAG has two stages to measure. Here are the four numbers that tell you where it broke. Start with a

The Two Stages: Distinguishing Retrieval from Generation

[0:15]Shape. A question goes in. First, retrieval finds the chunks it thinks are relevant. Then, generation writes an answer from those chunks. Two stages, two failure points, so you grade them separately. Grade retrieval with two numbers. Recall, of all the relevant

Grading Retrieval: Understanding Recall and Precision

[0:32]Chunks, how many did you actually retrieve? Miss some, and the answer can't be complete. Precision, of the chunks you retrieved, how many were relevant? Pull in junk, you distract the model. Both need a labeled set of right answers. Then, grade generation. Answer relevance, does the answer actually address the question? Faithfulness, is every claim backed by the retrieved context, or did the model invent it?

Grading Generation: Answer Relevance and Faithfulness

[0:57]These are usually scored by a second model, an LLM acting as judge. Here's the payoff. The number that drops tells you where to look. Low recall or precision, the context is wrong. Fix the chunking, the embeddings, or how many you pull. Low relevance or faithfulness, the

The Payoff: Letting the low number point you to the fix

[1:15]Context was fine, but the answer isn't. Fix the prompt or the model. Your turn. Run all four on your own RAG before you touch anything. Measure retrieval and generation separately, then let the low number point you at the fix. Guessing which half is broken is how you spend a week fixing the wrong stage. Where RAG breaks, more explainers soon. Humanitarian's AI.

More from Humanitarians AI Fellows

Humanitarians AI Lyrical Literacy Project