In this piece
RAG Evaluation: How to Measure Answer Quality
RAG evaluation is the habit of measuring a retrieval-augmented generation system in two halves, because it can fail in two different places. Retrieval can miss the right passage, or the model can ignore, twist or invent beyond the passage it was given. The practical answer is to score retrieval and generation separately, against a fixed eval set of real questions with reference answers and sources, and to rerun that set on every change to prompts, models, chunking or the index. A first useful eval set of 50 to 200 questions takes days, not months, to build, and it turns “the bot feels worse this week” into a number you can act on. This guide walks through the metrics that matter, how to build the set, how to check citations, and how to gate releases. It is the same approach we use when we build RAG systems for clients.
We reviewed the external references on 19 November 2026. Evaluation libraries change their APIs often, so check the current docs of the tool you use before copying any code.
Want to know how good your RAG answers really are?
Get your RAG evaluatedWhat should you measure in a RAG system?
The Ragas paper frames RAG quality as three questions: did retrieval find relevant, focused passages; did the model use them faithfully; and is the answer itself good. TruLens describes the same idea as the RAG triad: context relevance, groundedness and answer relevance. Whatever library you use, the metrics fall on one side of the pipeline or the other.
| Metric | Side | Question it answers | Needs a reference? |
|---|---|---|---|
| Context precision | Retrieval | Are the retrieved chunks relevant, and ranked near the top? | Usually |
| Context recall | Retrieval | Did we retrieve everything needed to answer? | Yes |
| Faithfulness (groundedness) | Generation | Is every claim in the answer supported by the retrieved context? | No |
| Answer relevance | Generation | Does the answer actually address the question? | No |
| Citation accuracy | Generation | Does each cited source contain the claim it is attached to? | No |
| Answer correctness | End to end | Does the answer match the reference answer? | Yes |
The split matters because the fixes are different. Low context recall points to chunking, embeddings, filters or missing documents. High recall with low faithfulness points to the prompt, the model or too much noisy context. One blended score cannot tell you which.
How do you build a RAG eval set?
An eval set is a file of questions, each with a reference answer and the source passages that support it. It is the most valuable asset in the project, more durable than any prompt. Build it like this:
- Collect real questions from support tickets, search logs, sales calls or a pilot, not questions the team invents.
- Have a subject-matter expert write the reference answer and point to the exact source section.
- Add the hard cases on purpose: questions with no answer in the documents (the right output is “I don’t know”), questions that need two sources, questions about content that changed recently, and questions with ambiguous terms.
- Tag each question by topic and difficulty, so you can see which slice got worse.
- Freeze a version, and add every bad answer users report as a new row.
{
"id": "refund-policy-014",
"question": "Can I get a refund after 30 days if the item is damaged?",
"reference_answer": "Yes. Damaged items can be returned within 90 days with photos.",
"reference_sources": ["policies/returns.md#damaged-items"],
"tags": ["policy", "multi-condition"],
"must_refuse": false
}Fifty good rows beat a thousand synthetic ones. Generated questions are useful to widen coverage later, but they tend to be easier than real questions and to mirror the wording of the documents, which flatters retrieval.
How do you measure faithfulness and citations?
Ragas defines faithfulness as the share of claims in the answer that can be inferred from the retrieved context, scored from 0 to 1. An LLM splits the answer into claims and checks each one. Note what it does not measure: a faithful answer can still be wrong if the retrieved document is out of date. That is why faithfulness sits next to correctness, not instead of it.
Citations need their own check. If your product shows sources, test that each cited passage actually contains the claim it is attached to, and that the answer cites the passage the expert pointed to. A common failure is an answer that is right but cites a neighboring chunk, which destroys user trust the first time someone clicks.
Context recall always needs a reference to compare against, which is another reason the expert-written reference answers in your eval set are worth the effort.
Calibrate the judge before you trust it
LLM-as-judge metrics are cheap to run and noisy. Before relying on them, have a person grade 30 to 50 answers and compare. If the judge and the person disagree often, change the judge prompt or model, or keep human review for that metric. Re-check agreement whenever you change the judge model.

"Teams spend weeks choosing a vector database and an afternoon on the eval set. It should be the other way round. The eval set is the only thing that tells you whether any of the other choices worked."
How do you stop RAG quality from regressing?
Treat the eval set as a test suite. Every change to the prompt, model, chunk size, embedding model, reranker or document set gets a run, and the result is compared with the last accepted baseline. The thresholds below are illustrative; set your own with the business owner of the use case.
# Illustrative release gate: run on every prompt, model or index change
eval run --set evals/support-v3.jsonl --out reports/candidate.json
eval compare reports/baseline.json reports/candidate.json \
--fail-if "faithfulness < baseline - 0.02" \
--fail-if "context_recall < baseline - 0.03" \
--fail-if "citation_accuracy < 0.95"- Store every run with the exact prompt, model version and index version, so a drop can be traced.
- Look at the failed rows, not just the averages. Ten failures in one topic is a different problem from ten spread out.
- In production, sample real conversations, score them with the same reference-free metrics, and send low scores to review.
- Track the “I don’t know” rate. A system that never refuses is usually inventing answers to unanswerable questions.
How Devoun handles this: on our RAG development projects, the eval set and release gate are built in the first weeks, before tuning starts, and the acceptance criteria are written against them. Work starts with a Discovery valued at $400, 50% free (you pay $200, credited to the build), and every milestone is covered by our money-back guarantee.
Frequently Asked Questions
What is the difference between retrieval metrics and generation metrics in RAG?
Retrieval metrics, such as context precision and context recall, check whether the search step found the right passages. Generation metrics, such as faithfulness and answer relevance, check whether the model used those passages correctly and answered the question. You need both to know which part to fix.
How many questions does a RAG eval set need?
Start with 50 to 200 real questions that cover your main topics, plus the hard cases: questions with no answer in the documents, questions that need two sources, and questions about recently changed content. Grow it every time a user reports a bad answer.
Can I use an LLM as a judge for RAG evaluation?
Yes, most faithfulness and relevance metrics use an LLM to split answers into claims and check them. Calibrate the judge first: have a person grade a sample of 30 to 50 answers and check that the judge agrees before you trust its scores.
What is a good faithfulness score?
There is no universal threshold. Measure your current baseline, decide with the business owner what level of unsupported claims is acceptable for the use case, and block releases that fall below it. Regulated or customer-facing answers need a stricter bar than internal search.
Final thoughts
A RAG system without an eval set is a demo. Measure retrieval and generation separately, build the eval set from real questions with expert answers, check citations as carefully as answers, and gate every release on the numbers. Then improving the system becomes engineering instead of guesswork.