RAG Evaluation: How to Tell If Your Answers Are Any Good
RAG evaluation tests whether your system retrieves the right documents and answers from them. Learn the checks, the test set and how to read the results.
On this page
Short answer
RAG evaluation is the process of testing a retrieval-augmented generation system against known questions with known good answers, to find out whether it retrieves the right documents and answers from them. Without it, a system can sound confident while citing the wrong source, missing the key passage or inventing details, and nobody can tell whether a change made it better or worse.
What is RAG evaluation?
RAG evaluation is the testing of a retrieval-augmented generation system: a language model that answers questions using documents it retrieves from your own store. The test asks the system a set of questions, compares its answers with answers a person has already checked, and records where it retrieved the wrong passage, answered from the wrong source or added something the documents never said.
It exists because a RAG system has two places to fail, not one. The retriever can fetch the wrong documents, and the model can write a good-looking answer from them that is still wrong. Testing only the final answer hides which half failed, and fixing the wrong half wastes weeks.
Evaluation is not a one-off launch check. Documents change, questions drift and models get updated, so the same test set should be run again whenever any of those change. A system that passed in January can fail in June because the handbook it reads was rewritten. For how the system itself is built, see how to implement RAG.
What should you measure?
You should measure retrieval quality and answer quality separately, because they fail in different ways and need different fixes. Five checks cover most of what matters.
| Check | What it asks | Fix when it fails |
|---|---|---|
| Retrieval precision | Did it fetch the right passages? | Better chunking or ranking |
| Groundedness | Is every claim in the documents? | Stricter prompts, fewer sources |
| Answer relevance | Does it answer the question asked? | Clearer prompts, better retrieval |
| Citation accuracy | Do the citations point at the claim? | Citation rules in the prompt |
| Refusal behaviour | Does it say so when the answer is missing? | Explicit refusal instructions |
Score each check as a simple pass or fail per question, then count the passes. A single blended score hides the pattern: a system can score well overall while failing every refusal case, which is the failure that hurts most in production.
How do you build a test set?
You build a test set from real questions your users actually ask, each paired with the correct answer and the documents that contain it. A test set made from questions nobody asks will pass a system that fails in production, because it never tests the hard cases.
Start with your logs: support tickets, search queries and questions staff answer by hand. Pick 50 to 100 that cover the main topics, and add the awkward ones on purpose: questions with two plausible answers, questions whose answer changed recently, and questions the documents cannot answer at all. The last group tests refusal, which is where many systems fail silently.
For each question, write down the correct answer in your own words and note which documents prove it. Keep the test set fixed once it is written, so every later run is comparable. If you change the test set each time, you cannot tell whether the system improved or the test got easier.
How do you run the evaluation?
You run the evaluation by feeding the test questions to the system exactly as a user would, then scoring each answer against the known good answer. Run it on a copy of the production setup, with the same documents, the same retrieval settings and the same model version.
A practical routine has four steps. First, freeze the test set and the document store so the run is repeatable. Second, run all questions and save every answer with the passages it cited. Third, score each answer by hand for the first few runs, using the five checks from the table above. Fourth, record the pass rate for each check, not just an overall score.
Hand scoring is slow, but it is the only reliable way at first. A second model can help with routine scoring later, once you have checked its scores against human scores on the same answers and found they agree. Until then, automated scores are a guess, not a measurement.
How do you read the results and fix failures?
You read the results by grouping the failures, not by staring at the overall score. Failures fall into a few patterns, and each pattern points at a different fix.
If the system retrieved the wrong passages, the problem is retrieval: the chunks may be too large, the ranking may favour popular documents over correct ones, or the question may need rewording before search.
If it retrieved the right passages but answered wrongly, the problem is the prompt or the model: the instructions may be unclear, or too many passages may be crowding out the right one.
If the system invented details, check whether the answer was grounded in the retrieved text at all. A model that answers from its own training instead of the documents needs stricter instructions to answer only from the given passages.
If it answered a question the documents cannot answer, add a refusal rule and test it with the unanswerable questions in your test set. Fix one pattern at a time and re-run the same test set, so you can see whether the fix helped.
Example (hypothetical): a support team tests 100 questions
Example (hypothetical): a support team builds a test set of 100 real questions from its ticket history, each with a checked answer and the help article that proves it. It runs the RAG system and scores each answer by hand.
The results: 82 answers are fully correct and grounded. Of the 18 failures, 9 retrieved the wrong article, 6 retrieved the right article but added a detail that was not in it, and 3 answered questions the articles could not answer instead of refusing. That adds up: 82 plus 9 plus 6 plus 3 equals 100.
The team fixes retrieval first, because it caused half the failures. It splits long articles into smaller chunks and re-runs the test. Retrieval failures fall from 9 to 4, and correct answers rise from 82 to 87. The invented-detail failures stay at 6, so the team tightens the prompt next, one pattern at a time.
What are the common mistakes?
The most common mistakes in RAG evaluation are testing with questions nobody asks, scoring only the final answer, and changing the test set between runs.
- Testing with made-up questions. A test set written from imagination misses the awkward real questions that break systems in production.
- One blended score. A single number hides whether retrieval or answering failed, and hides refusal failures entirely.
- Changing the test set each run. If the questions change, the scores are not comparable and improvement is impossible to prove.
- Trusting automated scoring too early. A second model scoring answers needs its own check against human scores first.
- Skipping unanswerable questions. A system that never refuses will invent answers, and that is the most damaging failure.
- Evaluating once at launch. Documents, questions and models all change, so the test must be re-run whenever any of them does.
Key takeaways
- Evaluation tests retrieval and answering separately — they fail differently
- Five checks cover most of what matters: retrieval precision, groundedness, relevance, citations and refusal
- Build the test set from real user questions, with checked answers and the documents that prove them
- Score by hand at first, record pass rates per check, and keep the test set fixed between runs
- Group failures by pattern and fix one at a time, re-running the same test set after each fix
- Re-run the evaluation whenever documents, questions or the model change
Frequently asked questions
How is RAG evaluation different from LLM evaluation?
General LLM evaluation tests a model on broad knowledge and language tasks. RAG evaluation tests a whole system on your own documents: whether it retrieved the right passages, whether the answer is grounded in them, and whether it refuses when the answer is missing. The test set must come from your real questions and documents.
How many questions should a test set have?
Start with 50 to 100 real questions covering your main topics, including awkward cases and questions the documents cannot answer. That is enough to show the main failure patterns. Larger sets help later, once the basic checks are stable and you want to compare small changes.
Can a model score the answers instead of a person?
It can help once you have checked its scores against human scores on the same answers and found they agree. Until that check is done, automated scoring is a guess. Even then, hand-score a sample of every run, because scoring models drift just like the systems they test.
What does groundedness mean?
Groundedness means every claim in the answer can be found in the documents the system retrieved. An answer can be fluent and plausible while being ungrounded, which is why the check matters: it catches the confident inventions that a quick read would miss.
Why do RAG systems fail to refuse?
Models are trained to be helpful, so they tend to answer even when the retrieved passages do not contain the answer. An explicit instruction to say the answer is not in the documents, plus test questions that cannot be answered, is the only reliable way to check this behaviour.
How often should we re-run the evaluation?
Re-run it whenever the documents, the questions or the model change, and on a regular schedule even if nothing changed — monthly is a sensible default. A system that passed months ago can fail silently when a handbook is rewritten or a model is updated.