How do you evaluate a RAG system end-to-end?
Evaluate the two stages separately, then the whole. Retrieval: on a labelled set of questions with known relevant documents, measure recall and precision (did the right chunks get fetched, and how many irrelevant ones came along?) using metrics like hit rate and MRR/NDCG. Generation given context: measure faithfulness (is the answer grounded in the retrieved chunks, no hallucination?) and answer relevance (does it actually address the question?), typically via LLM-as-a-judge. End-to-end: correctness against reference answers where they exist, plus human spot-checks. This separation is the key insight — a wrong final answer could be a retrieval miss (fix chunking/embeddings/re-ranking) or a generation failure (fix the prompt), and only stage-wise metrics tell you which.