← All questions
RAGMedium· RAG & Retrieval

How do you evaluate a RAG system?

On three separate axes, measured independently rather than as one end-to-end score:

  • Context relevance — did retrieval actually find the right material for this query?
  • Groundedness — does the generated answer actually follow from the retrieved context, rather than the model’s own prior knowledge?
  • Answer relevance — does the final answer actually address what the user asked?

Measuring these separately matters because when the system degrades in production, you need to know which layer broke. A single end-to-end score tells you something is wrong; it can’t tell you whether to go fix the retriever or the prompt.

Code playground (Python)