mediumRAG & Vector DatabasesReviewed Jul 8, 2026

How do you evaluate retrieval quality using recall@k, precision@k, and MRR/NDCG?

Retrieval metrics need a labeled set of queries with known relevant documents. Recall@k = fraction of all relevant docs that appear in the top k; for RAG this is often the most important metric because if the answer isn't retrieved, the LLM can't use it. Precision@k = fraction of the top k that are relevant, which matters when context window or reranking budget is tight. MRR (Mean Reciprocal Rank) rewards putting the first relevant result high; useful for single-answer lookups. NDCG accounts for graded relevance and position, discounting hits lower in the ranking. In practice, tune retrieval for high recall@k (e.g. retrieve 20-50), then use a reranker to improve precision at the smaller k you actually feed the LLM. Always report k explicitly.

evaluationmetricsrecallndcg

More RAG & Vector Databases questions

See all RAG & Vector Databases questions →