Evaluating a retrieval-augmented generation (RAG) system means measuring retrieval and generation separately, against a fixed test set with known-good answers, and then tracing every failure back to the pipeline stage that caused it. Scores alone rarely tell you what to fix; the diagnostic step is what turns an evaluation into an improvement.
This guide is aimed at practitioners who already have a RAG pipeline running — against a hosted API or a local model — and need a repeatable way to tell whether changes to chunking, embeddings, prompts, or the generator are actually helping. It covers the metric set, how to build test data that exposes real weaknesses, and how to classify failures so that fixes target the right component.
Why RAG evaluation is not ordinary LLM evaluation
A RAG system has at least two failure surfaces. The retriever can fail to surface the passage that contains the answer, and the generator can fail to use a passage that was surfaced correctly. A single end-to-end question such as “was the answer good?” collapses both into one number and tells you nothing about which component to change.
That collapse is also why RAG problems are easy to miss. Google Cloud’s guidance on RAG evaluation describes the culprit directly: systems that are not thoroughly evaluated produce “silent failures” which can undermine the reliability and trustworthiness of the system as a whole (Google Cloud Blog). A silent failure is an answer that reads fluently, cites something, and is still wrong. Nothing throws an exception, so nothing gets fixed.
The practical response is component-level evaluation: score retrieval and generation separately, then treat end-to-end scores as a summary rather than as a diagnostic.
The metric set: five dimensions that cover most RAG failures
A 2026 systematic literature review published in SN Computer Science, synthesising evidence from 12 studies focused on the evaluation of RAG systems, proposes a framework that integrates five dimensions — context relevance, faithfulness, answer relevance, correctness, and citation quality — and links each to corresponding metrics and to the dataset prerequisites needed to compute them (SN Computer Science). The same review reports substantial variation in how RAG systems are evaluated in practice, which is a useful warning: metric names are not standardised across tools, so define yours explicitly before comparing results.
| Dimension | Question it answers | Stage it diagnoses |
|---|---|---|
| Context relevance | Do the retrieved passages actually relate to the query? | Retrieval |
| Faithfulness | Is every claim in the answer supported by the retrieved context? | Generation |
| Answer relevance | Does the answer address the question that was asked? | Generation |
| Correctness | Does the answer match a known-good reference answer? | End to end |
| Citation quality | Do cited sources exist and support the sentences they are attached to? | Generation and attribution |
Retrieval-side metrics
Context relevance is the cheapest useful signal in the set. If you have labelled relevant passages, you can compute precision and recall at your chosen k directly. If you do not, a judge model or a human reviewer can rate each retrieved chunk as relevant, partially relevant, or irrelevant to the query. The failure signature to watch for is a query whose top-ranked chunks are topically adjacent but do not contain the answer — often a chunking or embedding problem rather than a prompting one.
Generation-side metrics
Faithfulness is the anti-hallucination metric: it asks whether the claims in the answer are supported by the context that was actually retrieved. A high-faithfulness answer can still be wrong if the retrieved context was wrong, which is exactly why it must be read alongside context relevance. Answer relevance catches the opposite problem — an answer that is well-grounded but does not address the question, a common symptom of an over-stuffed or poorly ordered context window.
Correctness is the only dimension that requires a reference answer, and it is the one that most closely matches what users care about. Citation quality matters whenever the interface displays sources: an answer can be factually correct while attributing the claim to the wrong document, which damages trust as soon as a user clicks through.
Building a test set that actually finds failures
Google Cloud’s evaluation guidance sets out two artefacts to assemble up front: a test dataset of high-quality questions, and a “golden” reference dataset of desired outputs. The guidance recommends that the question set cover a broad subset of the underlying data and include variations in phrasing and question complexity that match real-world use cases, and it suggests consulting stakeholders and end users so the dataset stays relevant (Google Cloud Blog).
In practice, coverage matters more than raw size. A useful seed set deliberately mixes several question types:
- Single-fact lookups — the answer sits in one passage. These should nearly always pass; failures here point to indexing gaps.
- Multi-hop questions — the answer requires combining two or more passages. These expose retrieval ranking and context-assembly weaknesses.
- Version- or date-specific questions — the answer depends on which document revision is current. These expose metadata problems.
- Ambiguous questions — several readings are possible. These test whether the system asks for clarification or guesses.
- Unanswerable questions — the corpus does not contain the answer. A RAG system that always answers is not safe, and only an explicit set of out-of-scope questions will reveal that behaviour.
Golden answers should be short, verifiable, and tied to a specific source document identifier. Store the test set under version control alongside the pipeline configuration, and treat a change to the test set as a change to the measurement instrument — record it, and re-run the previous configuration so the comparison stays honest.
Running the evaluation reproducibly
Reproducibility comes from freezing everything that can drift: chunk size and overlap, embedding model and its version, the index snapshot, retriever k and any reranking step, the prompt template, the generator model and decoding settings, and the judge model. Log one record per question containing the retrieved chunk identifiers and scores, the generated answer, and each metric verdict. Without that per-question record you can compute an average but you cannot diagnose anything.
Using a model as the judge is the usual way to scale this, and it has its own error modes: judges can be biased toward longer answers, toward their own outputs, or toward a particular phrasing. Calibrate the judge on a subset of questions that a human has labelled, and report agreement rather than assuming it. Running the judge locally keeps evaluation data on-premises and removes per-call cost, but judge quality then depends entirely on the local model you choose — a tradeoff worth measuring rather than assuming.
Finally, automate the run so it fires on every change to chunking, prompts, models, or the underlying corpus. RAG quality regresses silently when a document is re-indexed or a prompt is edited for one edge case.
Failure analysis: turning scores into fixes
Once a run is complete, triage each failing question in a fixed order, starting with the cheapest inspection:
- Read the retrieved context first. If the passage containing the answer is absent, this is a retrieval failure. Check chunking boundaries, the embedding model, query rewriting or expansion,
k, and any metadata filters. - If the passage is present but the answer is wrong, it is a generation failure. Check the prompt template, the ordering of chunks in the context, truncation when the context exceeds the window, and the generator model itself.
- If the answer is correct but cites the wrong source, treat it as an attribution failure and inspect how citations are mapped back to chunks.
- If the answer is correct but the question was out of scope, the issue is in the test set or in how the system’s scope is defined — not in the pipeline.
Cluster failures by root cause rather than fixing them one by one, and count how many questions each cause explains. A single chunking boundary that splits a table in half can account for a dozen failures across unrelated topics, and that count is what justifies the fix.
An illustrative failure walkthrough
The following scenario is illustrative, not a measured result. A documentation assistant built on a WordPress knowledge base receives the question “How do I change the permalink structure?” The retriever returns a well-matched chunk, the generator summarises it accurately, and the answer is fluent and fully grounded in the retrieved text. Correctness against the golden answer is nonetheless low, because the chunk came from an older plugin version and the index contains both versions without a version field in the metadata.
The metric combination localises the fault precisely: context relevance is high, faithfulness is high, correctness is low. That pattern points at corpus and metadata curation rather than at the model or the prompt. The fix is to add version metadata and filter on it, or to re-index only the current documentation — and then to re-run the same frozen test set to confirm the regression is closed.
Limitations and tradeoffs
No single metric proves production readiness. The five dimensions above are a coverage checklist, not a score to optimise. Golden datasets go stale as source content changes, so schedule refreshes rather than treating the set as permanent. Correctness requires reference answers, which many teams do not have at the start; beginning with context relevance, faithfulness, and answer relevance is a legitimate interim position. Judge models inherit biases that must be calibrated against human labels. And because metric definitions vary between tools and papers, cross-tool score comparisons are unreliable — compare configurations within your own harness instead.
What to do next
Start small and specific: write down your own definitions of the five dimensions, seed a test set from real user questions and search logs, and add golden answers for the subset where correctness matters most. Build a script that emits one record per question, run it before and after your next pipeline change, and triage the failures using the ordered checks above. If you are running models locally, decide early whether the judge runs locally too, and validate it before you trust a number it produces.
If you have a metric set, a failure taxonomy, or a test harness that caught a regression others would have missed, consider sharing the setup and the environment details with the Ai-Forum community so the results can be reproduced and compared.
FAQ
Can I evaluate a RAG system with a single end-to-end score?
You can compute one, but it will not tell you what to fix. Because retrieval and generation fail in different ways, scoring context relevance separately from faithfulness and answer relevance is what makes a failure diagnosable.
Do I need a golden reference dataset?
Not for every metric. Google Cloud's guidance notes that some metrics can be calculated without a reference dataset, but a set of known-good outputs allows a more comprehensive and nuanced range of evaluation — and correctness specifically depends on having references.
How large should the RAG test set be?
The sources reviewed here do not prescribe a size. They emphasise coverage of the underlying data and variation in phrasing and question complexity that matches real use cases, which matters more than raw question count.
Why does a RAG system give fluent but wrong answers?
Usually because the retrieved context was wrong, outdated, or incomplete while the generator faithfully summarised it. High faithfulness combined with low correctness is the signature of a corpus or retrieval problem, not a prompting problem.