Skip to content

Evaluating RAG Quality

Briefly

Evaluating RAG visually across thousands of documents is impossible. Frameworks like Ragas are used with a trio of metrics: context relevance, groundedness, and answer relevance.

Problem

How to understand if the system is searching well and not hallucinating? Manually checking a thousand responses is unrealistic. The solution is LLM-as-a-Judge: another powerful model evaluates the quality based on predefined criteria.

RAG Triad

  1. Context Relevance — how relevant are the found chunks to the question? Shows the quality of chunking, embeddings, and search.
  2. Groundedness / Faithfulness — is the answer based solely on the context? Catches hallucinations.
  3. Answer Relevance — does the text directly answer the question? Shows the quality of the final LLM.

Frameworks

  • Ragas — industry standard, integrates with LangChain.
  • TruLens — alternative with tracing chains.

See Also