RAG Evaluation Metrics: How to Measure Retrieval and Generation Quality

Introduction
Retrieval-Augmented Generation (RAG) is widely used to connect language models with external knowledge sources. However, building a RAG pipeline does not automatically guarantee accurate answers.
A system can retrieve irrelevant documents, miss important information or generate responses that are unsupported by its retrieved context.
This is why RAG evaluation is essential.
A useful evaluation strategy separates retrieval quality from generation quality instead of relying on a single overall accuracy score.
1. Context Precision
Context precision measures whether the retrieved information is relevant to the user's question.
For example, if a user asks about employee leave policies, retrieving documents about company marketing is undesirable.
Higher context precision generally indicates better retrieval ranking.
2. Context Recall
Context recall measures whether the retrieval system captures the information needed to answer the question.
A system might retrieve one relevant document but miss another document containing a critical exception.
High recall is particularly important for complex questions requiring information from multiple sources.
3. Faithfulness
Faithfulness evaluates whether the generated answer is supported by the retrieved context.
For example:
Retrieved context: Employees receive 20 annual leave days.
Generated response: Employees receive 30 annual leave days.
This is a faithfulness failure because the generated statement contradicts the evidence.
4. Answer Relevancy
Answer relevancy evaluates whether the response directly addresses the user's question.
An answer can be factually correct but still irrelevant if it does not solve the actual problem.
5. Answer Correctness
Answer correctness compares the generated response against a verified reference answer.
This helps identify whether the system produces the expected factual information.
6. Noise Sensitivity
Noise sensitivity evaluates how the system behaves when irrelevant or misleading information appears in the retrieved context.
This is especially useful for enterprise knowledge bases containing duplicated, outdated or conflicting documents.
A Practical RAG Evaluation Framework
A useful evaluation dataset should contain:
User questions
Expected answers
Retrieved documents
Generated answers
Relevant reference context
A typical evaluation pipeline looks like this:
Create a representative question dataset.
Run every question through the RAG pipeline.
Capture retrieved documents and generated responses.
Evaluate retrieval metrics independently.
Evaluate generation metrics independently.
Compare results across model, prompt and retrieval configurations.
Investigate failed examples and improve the pipeline.
Tools such as RAGAS and LangSmith can help automate parts of this process.
Why One Score Is Not Enough
Consider two RAG applications:
Application A retrieves highly relevant documents but generates unsupported answers.
Application B generates well-grounded answers but frequently misses important documents.
Both have different problems, even if their overall scores appear similar.
Evaluation should therefore use a collection of metrics and a failure-analysis process.
Conclusion
RAG evaluation is not just about measuring whether an answer looks correct. It requires understanding how information is retrieved, ranked, interpreted and transformed into a response.
A well-designed evaluation framework makes RAG systems measurable, comparable and continuously improvable.