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
- Context Relevance — how relevant are the found chunks to the question? Shows the quality of chunking, embeddings, and search.
- Groundedness / Faithfulness — is the answer based solely on the context? Catches hallucinations.
- 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.