A RAG answer can be wrong because retrieval missed the source or because the model misused it. Separate the two.
Retrieval metrics
- Recall at k: does the correct passage appear in the top k results?
- Precision: how much of what was retrieved is relevant?
- Ranking quality: is the best passage near the top?
Generation metrics
- Faithfulness (groundedness): is every claim supported by the retrieved context?
- Answer relevance: does it answer the question asked?
- Completeness: does it include the needed details?
- Citation accuracy: do the citations point to supporting passages?
Build the test set
Collect real questions, mark the source passages and expected answers, and include questions the corpus cannot answer. Even fifty well-chosen items reveal most problems.
Automate where sensible
Use code for retrieval metrics and citation checks, and a calibrated LLM judge for faithfulness, with human sampling.
Use results
Low recall points to chunking or hybrid search. Low faithfulness points to prompts, context size or model choice.
Frequently asked questions
What is faithfulness in RAG?
The degree to which an answer's claims are supported by the retrieved context.
How many test questions do I need to evaluate RAG?
A few dozen representative questions, including unanswerable ones, is a useful start. Grow it from real failures.
How do I tell retrieval problems from generation problems?
Check whether the correct passage was retrieved. If not, fix retrieval. If it was and the answer is wrong, fix prompting or the model.
Related: RAG development · Evaluating AI agents · Reducing hallucinations
Want a straight answer for your project?
Book a 30-minute call. I will tell you what I would do, and a fixed price if it makes sense.