# How to Evaluate a RAG System: Metrics and a Test Set

> RAG evaluation in practice: retrieval metrics such as recall and MRR, answer metrics such as faithfulness, a 50-question golden set and regression runs.

- Author: Naman Gundaniya (https://hellonaman.com)
- Published: 2026-12-01
- Updated: 2026-12-01
- Canonical URL: https://hellonaman.com/blog/rag-evaluation

Evaluate a RAG system in two halves. Score retrieval with recall at k and mean reciprocal rank against passages you have marked as correct. Score answers for faithfulness to the retrieved text and relevance to the question. Run both on a fixed set of about 50 real questions every time you change the pipeline.

A retrieval-augmented system can fail in two places: the retriever does not find the right passage, or the model has the right passage and still answers badly. A single overall score hides which one happened, so the fix becomes guesswork. This post sets out the metrics for each half, how to build a small golden set that makes them meaningful, the tools that compute them, and how to turn the whole thing into a regression run.

For background on retrieval itself, see [RAG vs fine-tuning](https://hellonaman.com/blog/rag-vs-fine-tuning). For agents in general, I have a separate post on [evals that prevent agent failures](https://hellonaman.com/blog/ai-agent-evaluation).

## Which metrics tell you whether retrieval is working?

Retrieval is working when the passages that answer a question appear in the results, near the top. Three classic ranking metrics measure that, and all three need labelled relevant passages. The definitions below follow the [Elasticsearch ranking evaluation documentation](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/search-rank-eval), which implements them.

| Metric | What it measures | Read it as |
| --- | --- | --- |
| Recall at k | Share of all relevant passages that appear in the top k results | "Did we find it at all?" |
| Precision at k | Share of the top k results that are relevant | "How much of what we passed on was noise?" |
| Mean reciprocal rank (MRR) | Average of 1 divided by the rank of the first relevant result | "How high was the first good hit?" |

A reciprocal rank example from the same documentation: if the first relevant result is in position 3, the reciprocal rank for that query is 1/3. Averaging across the test set gives MRR.

For RAG, recall at k is the one to watch first, with k set to the number of chunks you pass to the model. If the right passage is not in the context, nothing downstream can save the answer. Anthropic's [contextual retrieval study](https://www.anthropic.com/news/contextual-retrieval) reports its results as 1 minus recall at 20, the share of relevant passages that fail to appear in the top 20 chunks, which is a useful way to phrase the number: a failure rate.

MRR matters more when you pass only a few chunks or show sources to users. Precision matters when irrelevant chunks start to distract the model or inflate token cost.

![A RAG pipeline drawn left to right: a golden set of 50 questions feeds a retriever, which returns chunks to a generator, which produces an answer. Under the retriever are the retrieval metrics: recall at k, MRR and context precision, compared against marked passages. Under the generator are the answer metrics: faithfulness, answer relevancy and correctness, compared against reference answers. An arrow loops from the scores back to the start, labelled re-run on every change.](https://hellonaman.com/blog/rag-evaluation/diagram.svg)

*Retrieval metrics and answer metrics attach to different stages of the pipeline.*

## Which metrics tell you whether the answers are good?

An answer is good when it is supported by the retrieved text, addresses the question, and matches the known correct answer. Those are three separate checks, and each catches a different failure.

- **Faithfulness.** The [Ragas faithfulness metric](https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/faithfulness/) breaks the response into claims, checks whether each claim can be inferred from the retrieved context, and reports the supported share as a score from 0 to 1. A low score means the model added facts the context did not contain.
- **Answer relevancy.** The [Ragas answer relevancy metric](https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/answer_relevance/) generates questions from the response and compares them with the original question by embedding similarity. Its documentation is explicit that this metric does not evaluate factual accuracy; it penalises answers that are incomplete or padded.
- **Correctness.** Comparing the answer with a reference answer you wrote. This is the only one of the three that needs a human-written answer, and it is the one that catches a faithful summary of the wrong passage.

Ragas also provides LLM-judged versions of the retrieval metrics. Its [context recall metric](https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/context_recall/) splits the reference answer into claims and checks how many can be attributed to the retrieved context, which lets you estimate recall without labelling passages by hand.

A caution on judges. Faithfulness and relevancy scores come from a model grading another model. Anthropic's [evaluation guidance](https://platform.claude.com/docs/en/test-and-evaluate/develop-tests) ranks code-based grading as the fastest and most reliable method, and says of LLM-based grading: test to ensure reliability first, then scale. In practice I hand-grade 20 to 30 answers, compare them with the judge's scores, and adjust the rubric until the two agree before trusting the automated number.

## How do you build a 50-question golden set?

A golden set is a fixed list of questions with the passages that answer them and a reference answer for each. Fifty is a working size I use on client projects, not a threshold from research: small enough to label carefully in a day or two, large enough that a single fixed question moves the score by two points.

- **Collect real questions.** Pull from support tickets, search logs or sales calls. If the system is not live, ask the people who will use it to write the questions they would actually type.
- **Cover the query types.** The [Ragas test generation docs](https://docs.ragas.io/en/stable/concepts/test_data_generation/rag/) distinguish single-hop questions, answered from one passage, from multi-hop questions that need information from two or more sources, and specific from abstract phrasing. Include each kind.
- **Add questions with no answer.** Five or so that the corpus cannot answer. The correct behaviour is to say so, and you want to measure it.
- **Mark the evidence.** For each question, record the text spans that answer it. Spans survive re-chunking; chunk IDs do not. I explain why in the post on [RAG chunking strategies](https://hellonaman.com/blog/rag-chunking-strategies).
- **Write the reference answer.** Two or three sentences, with the specific facts a correct answer must contain.
- **Have a subject expert review it.** Ambiguous questions and wrong reference answers will otherwise cost you weeks of chasing false failures.

Synthetic questions generated from your documents are useful for volume once the hand-built set exists. Anthropic's guidance favours more questions with automated grading over fewer hand-graded ones. I use both: the 50 as the trusted core, and a larger synthetic set to catch regressions the core misses.

## Which tools compute RAG metrics?

Open-source frameworks compute these metrics for you; the main choice is between LLM-judged metrics that need no labels and metrics calibrated against human labels.

- **Ragas** is the framework I see most often. The [Ragas paper](https://arxiv.org/abs/2309.15217) introduced it as reference-free evaluation, meaning its core metrics work without human-annotated ground truth. Its documentation now lists context precision, context recall, noise sensitivity, response relevancy and faithfulness under retrieval-augmented generation.
- **ARES**, from a [NAACL 2024 paper](https://arxiv.org/abs/2311.09476) by Jon Saad-Falcon and colleagues, scores context relevance, answer faithfulness and answer relevance with fine-tuned lightweight judges, and uses a small set of human annotations (the abstract says a few hundred) to correct the judges' errors statistically.
- **TruLens** organises the same ground into what it calls the [RAG triad](https://www.trulens.org/getting_started/core_concepts/rag_triad/), built on the observation that RAG systems still hallucinate when retrieval fails to return sufficient context.
- **A classifier in place of an LLM judge.** The Ragas faithfulness page documents a variant that uses Vectara's open HHEM-2.1 model to check claims against context, which is cheaper to run at volume than an LLM call per claim.

The classic ranking metrics need no framework. Recall at k and MRR are a few lines of code over your labelled spans.

## How do you turn evaluation into a regression run?

A regression run executes the golden set against the current pipeline and compares the scores with the last accepted run. The comparison, not the absolute score, is what tells you whether a change helped.

- **Trigger it on every change that can affect answers:** chunking, embedding model, retriever settings, prompt, generation model.
- **Store results per question,** not only the averages. An average can stay flat while five questions improve and five break.
- **Report retrieval and answer metrics side by side.** Retrieval recall falling with faithfulness steady points at the index; the reverse points at the prompt or model.
- **Fix the judge.** Pin the judge model and rubric, or score changes will reflect the judge and not your system.
- **Feed production back in.** When a user reports a bad answer, add the question to the set. Tracing, covered in [observability for LLM apps](https://hellonaman.com/blog/llm-observability), is how you find those cases.

## Work with me

I set up evaluation for retrieval systems and agents as part of the build, working remotely from India, so every later change is measured against the same test set. See [AI integration](https://hellonaman.com/services/ai-integration) and [AI agent development](https://hellonaman.com/services/ai-agent-development), or browse [my work](https://hellonaman.com/work) and book a scoping call.

## FAQ

### How many test questions does a RAG evaluation need?

There is no standard number. I start with about 50 hand-labelled questions because that is enough to see patterns and small enough to label well, then add synthetic questions for coverage. The ARES paper reports accurate evaluation using only a few hundred human annotations, which gives a sense of the upper end.

### Can I evaluate a RAG system without ground-truth answers?

Partly. Faithfulness and answer relevancy need only the question, the retrieved context and the response, which is the reference-free approach the Ragas paper describes. Recall and correctness need a reference to compare against, so a system evaluated without one can be faithful and still wrong.

### What is a good faithfulness score?

There is no universal threshold, and I would not quote one. The score depends on the judge model and how claims are split. Use it comparatively: set a baseline on your golden set, read the lowest-scoring answers by hand, and treat any drop after a change as a failure to investigate.

### Should I evaluate retrieval and generation separately?

Yes. A combined score cannot tell you whether to fix the index or the prompt. Measuring retrieval first also saves money, since retrieval metrics need no model calls when you have labelled spans.

## Sources

- [Elasticsearch ranking evaluation documentation (elastic.co)](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/search-rank-eval)
- [contextual retrieval study (anthropic.com)](https://www.anthropic.com/news/contextual-retrieval)
- [Ragas faithfulness metric (docs.ragas.io)](https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/faithfulness/)
- [Ragas answer relevancy metric (docs.ragas.io)](https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/answer_relevance/)
- [context recall metric (docs.ragas.io)](https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/context_recall/)
- [evaluation guidance (platform.claude.com)](https://platform.claude.com/docs/en/test-and-evaluate/develop-tests)
- [Ragas test generation docs (docs.ragas.io)](https://docs.ragas.io/en/stable/concepts/test_data_generation/rag/)
- [Ragas paper (arxiv.org)](https://arxiv.org/abs/2309.15217)
- [NAACL 2024 paper (arxiv.org)](https://arxiv.org/abs/2311.09476)
- [RAG triad (trulens.org)](https://www.trulens.org/getting_started/core_concepts/rag_triad/)
