RAG pipelines fail in two places: retrieval brings back the wrong context, or the model answers without grounding itself in what was retrieved. RAG evaluation measures both - so you know whether your retrieval actually works, not just whether the model talks fluently.
Two failure modes
Classic RAG debugging falls into either:
- Bad retrieval - the relevant documents never made it into the context.
- Bad generation - the context had what it needed, but the model hallucinated beyond it.
Good RAG evaluation targets each with its own metric.
The metrics that matter
- Context relevance - are the retrieved documents relevant to the question? This isolates retrieval quality.
- Faithfulness / groundedness - is every claim in the response supported by the provided context? This catches hallucination.
- Citation accuracy - do citations actually point to sources that support the claim?
Building a RAG evaluator
Most of these are reference-based LLM evals: they compare the response against the retrieved context using an AI judge with clear criteria and evaluation steps.
# A groundedness evaluator's judge criteria (simplified)
"Is every claim in the response supported by the
retrieved context? A faithful response only states
facts verifiable from the provided documents."
# Steps
# 1. Identify every factual claim
# 2. Find supporting evidence in the context
# 3. Mark SUPPORTED / UNSUPPORTED / HALLUCINATED
# 4. Score by the proportion of supported claims
From scores to action
RAG evaluation is only useful when it drives changes. Track scores over time and follow a regression back to the release:
- Run a scoring run on a frozen test set version before every prompt release.
- Watch Logs for answers that stop being grounded, rate them Bad, and add them to the test set.
- When faithfulness drops, check the retrieval step - chunking, embedding, and reranking matter as much as the prompt.
If you can't measure retrieval quality, you can't improve it - RAG evaluation makes the invisible visible.
Try RAG evaluation in Infere
Infere has no evaluator called groundedness, and the rubric above is what you would put in one. An evaluator is a file in your repository, judged one of three ways: by a model, by your code, or by a fixed rule. The eight templates cover the common cases - Follows the instructions, Cites accurately, Resists prompt injection, Meets disclaimer rules, No personal data in the response, Valid Markdown, Well-formed tool calls, Within a length limit. Cites accurately, judged by a model, is the closest template to the groundedness rubric above; Write your own evaluator covers the rest. Logs keeps every request with its scores, so a bad answer is one click from the test set. Build a test set, score a frozen version with a scoring run, and put a check on the release to production.
RAG pipelines add up in tokens - our true cost of agentic coding guide breaks down how retrieval context and agentic loops drive spend. For the broader evaluation taxonomy, see our LLM evaluation guide.