Home>Blogs>How to Evaluate a RAG System: Metrics, Tests and a Checklist

How to Evaluate a RAG System: Metrics, Tests and a Checklist

RAG evaluation scorecard separating retrieval metrics from generation metrics with pass and fail thresholds

RAG evaluation scorecard separating retrieval metrics from generation metrics with pass and fail thresholds

A RAG system can fail in two places. The retriever can fetch the wrong passages, or the model can misuse the right ones. A single "answer quality" score hides which one broke.

This guide shows how to evaluate a RAG system component by component. It covers the retrieval and generation metrics specific to RAG, how to build a labeled test set, tests that isolate failures, a sample scorecard and a pre-launch checklist.

It deliberately leaves out general LLM release metrics such as latency, cost and safety rates. Those are covered in our guide to LLM evaluation metrics before launch.

Why RAG Needs Its Own Evaluation

In a plain chatbot, a wrong answer has one suspect: the model. In RAG, there are at least four: the chunking, the retriever, the reranker and the generator. Each fix is different.

The RAG evaluation survey on arXiv frames evaluation the same way, splitting targets into retrieval and generation. Evidently's RAG evaluation guide also separates the two.

Step 1: Build a Labeled Test Set

Every metric below depends on a test set where you know the right passages and, ideally, the right answer.

• Question: written the way real users ask it, including typos and vague wording

• Relevant passage IDs: the chunk or document IDs that contain the answer

• Reference answer: a short, human-approved answer, where one exists

• Question type: single-fact, multi-passage, comparison, no-answer, permission-restricted

• Source date: so you can test freshness when documents change

Include questions the corpus cannot answer. A RAG system that invents answers when nothing relevant exists is a serious failure, and you only see it if you test for it.

Step 2: Score Retrieval

Retrieval metrics compare the passages returned for each question with the labeled relevant passages.

MetricQuestion it answersWhen to watch it
Hit rate @kDid at least one relevant passage appear in the top k?Basic health check for every release
Recall @kWhat share of all relevant passages appeared in the top k?Multi-passage questions
Precision @kWhat share of the top k passages were relevant?When context windows fill with noise
MRRHow high was the first relevant passage, on average?When only the top few passages reach the model
NDCG @kWere the most relevant passages ranked highest?After adding a reranker

Pick k to match what you actually send to the model. If you pass five passages, Recall @20 tells you little about what the model sees.

Step 3: Score Generation Given the Context

Generation metrics ask whether the model used the retrieved passages well. The RAGAS paper defines faithfulness, answer relevance and context relevance as core reference-free measures.

• Faithfulness: share of claims in the answer supported by the retrieved context

• Answer relevance: does the answer address the question asked?

• Context utilization: did the model use the relevant passage it was given, or ignore it?

• Citation accuracy: does each cited source actually support the sentence it is attached to?

• Correctness vs reference: does the answer match the human reference answer?

Faithfulness and correctness are different. If the source document is outdated, an answer can be fully faithful and still wrong. Track both.

Step 4: Run RAG-Specific Failure Tests

These tests target behaviors that general LLM evaluation does not cover.

No-Answer Test

Ask questions the corpus cannot answer. The system should say it does not have the information. Score the share of correct abstentions. The survey above calls this negative rejection.

Conflicting-Source Test

Add two versions of a policy with different effective dates. Ask about the rule. A good system uses the current version or flags the conflict; a weak one blends both.

Permission Test

Ask, as a low-privilege user, a question answered only in a restricted document. The restricted passage must not be retrieved, quoted or summarized. Any leak is a release blocker.

Distractor Test

Insert passages that share keywords with the question but do not answer it. Check whether precision drops and whether the model is misled.

Component Swap Test

Feed the generator the labeled relevant passages directly, bypassing retrieval. If answers improve sharply, your problem is retrieval. If they stay poor, look at the prompt or model.

The component swap test is the fastest way to stop arguing about where the problem lives.

Sample RAG Evaluation Scorecard

The scorecard below is a template. The thresholds are illustrative placeholders, not recommended values; set your own from the risk of the use case. The "Example result" column shows how a team might fill it in.

AreaMetricHow measuredThreshold (set your own)Example resultStatus
RetrievalHit rate @5Labeled passage IDs in top 5e.g., ≥ 0.900.86Fail
RetrievalMRRRank of first relevant passagee.g., ≥ 0.700.74Pass
RetrievalPrecision @5Relevant share of top 5e.g., ≥ 0.500.41Watch
GenerationFaithfulnessClaims supported by context, judge + human samplee.g., ≥ 0.950.96Pass
GenerationCitation accuracyHuman check of cited passagese.g., ≥ 0.950.89Fail
GenerationCorrectnessMatch to reference answere.g., ≥ 0.850.83Watch
RobustnessNo-answer abstentionUnanswerable questions correctly declinede.g., ≥ 0.900.78Fail
RobustnessConflicting sourcesCurrent version used or conflict flaggede.g., 100%9 of 10Fail
AccessPermission leakageRestricted content in any answer0 cases0Pass

How to read this example: retrieval misses some answers (hit rate) and fills context with noise (precision). The generator is faithful but cites loosely. The system also guesses when it should abstain. Fix retrieval first, then citation formatting, then the abstention instruction.

Diagnosing From the Scorecard

• Low hit rate, good faithfulness: retrieval problem. Revisit chunking, hybrid search or the embedding model.

• Good hit rate, low faithfulness: generation problem. Tighten the prompt to answer only from context.

• Good hit rate, low context utilization: passages may be too long or ranked poorly; try a reranker or smaller chunks.

• Low abstention: add explicit "say you do not know" instructions and test again.

• Any permission leak: stop. Fix access filters at retrieval time, not in the prompt.

Our guides on combining keyword and vector search and RAG pipeline stages cover the retrieval-side fixes.

Using an LLM as a Judge

Faithfulness and relevance are often scored by another model, as RAGAS does. That scales, but a judge can be wrong.

○ Score a sample by hand and compare with the judge before trusting it

○ Keep the judge model and prompt versioned, like the system under test

○ Re-check agreement whenever you change the judge

○ Use humans for citation accuracy and for high-risk answers

Anyscale's RAG evaluation docs describe faithfulness as claims supported divided by total claims, which is easy for reviewers to audit.

When to Re-Run the Evaluation

• After changing chunking, embeddings, the index or the reranker

• After changing the prompt or model

• After a large batch of new or updated documents

• On a schedule, with fresh questions sampled from real usage

Keep the old test set as a regression suite and add new failures to it. A shrinking set of known failures is the clearest sign of progress.

Pre-Launch RAG Evaluation Checklist

• Labeled test set with relevant passage IDs and reference answers

• No-answer, conflicting-source, permission and distractor questions included

• Retrieval metrics reported at the k you actually send to the model

• Faithfulness and citation accuracy scored, with a human-checked sample

• Component swap test run to confirm where failures come from

• Thresholds set per metric and agreed with the business owner

• Zero permission leaks across all test users

• Judge model agreement with humans checked

• Scorecard and test set versioned with the release

Our Own Product Note

Disclosure: this is our own service. LuMay's AI development services include building and evaluating RAG flows. For tools that automate scoring, see our comparison of LLM evaluation tools.

Next Step

Copy the scorecard, label 50 of your real questions with their source passages and run the component swap test first. It will tell you where to spend the next sprint.

References

• Yu et al., Evaluation of Retrieval-Augmented Generation: A Survey (arXiv): https://arxiv.org/abs/2405.07437

• Es et al., RAGAS: Automated Evaluation of Retrieval Augmented Generation (arXiv): https://arxiv.org/abs/2309.15217

• Evidently AI, RAG evaluation guide: https://www.evidentlyai.com/llm-guide/rag-evaluation

• Anyscale, RAG evaluation: https://docs.anyscale.com/rag/evaluation

Tags:

#RAG#AI Evaluation#LLMOps#AI Development

Frequently Asked Questions

Everything you need to know about Engineering Services

1. What is RAG evaluation?

It is measuring how well a retrieval-augmented generation system finds the right passages and uses them to produce correct, supported answers, with retrieval and generation scored separately.

2. What are the main RAG retrieval metrics?

Hit rate @k, recall @k, precision @k, mean reciprocal rank (MRR) and NDCG @k, each computed against labeled relevant passages.

3. What is faithfulness in RAG?

The share of claims in an answer that the retrieved context supports. Low faithfulness means the model added information the sources do not contain.

4. Is faithfulness the same as correctness?

No. An answer can faithfully repeat an outdated source and still be wrong. Measure both, and test with changed documents.

5. How many test questions do I need?

Enough to cover each question type and important document group. Start with your most common real questions and add every failure you find.

6. Do I need reference answers?

Not for every metric. Faithfulness and answer relevance can be reference-free, but correctness needs approved reference answers.

7. How do I tell if retrieval or generation is the problem?

Run the component swap test: give the model the correct passages directly. If answers improve sharply, retrieval is the bottleneck.

8. Can I trust an LLM judge?

Only after comparing it with human scores on a sample. Version the judge and recheck agreement when you change it.

9. How do I test that RAG respects permissions?

Query as users with different access levels and confirm restricted passages are never retrieved or summarized. Treat any leak as a blocker.

10. What is negative rejection?

The system's ability to decline when the corpus has no relevant information, instead of inventing an answer.

11. How does this differ from general LLM evaluation?

General evaluation covers task success, safety, latency and cost. RAG evaluation adds retrieval quality, grounding in sources, citations, abstention and access control.

About the Editorial Team

Sarath Babu

Sarath Babu

Content Writer and SEO Specialist at Lumay

Creates insightful content on SEO, AI-powered marketing, digital growth, and emerging technologies. He simplifies complex topics into practical, research-backed guidance.

Palanisamy

Palanisamy

CEO and Founder at LuMay

27+ years of experience leading enterprise-scale AI, data, and systems architecture initiatives, delivering mission-critical platforms with a strong emphasis on trust, governance, and reliability.