Define recall@k in the embedding retrieval context
Recall@k is the fraction of queries where at least one relevant document appears in the top-k retrieved results.
Picture asking a librarian for any book about World War II and watching them grab the top 10 from the shelf. Recall@10 asks one question: did at least one actual WW2 book make it into those 10? If yes, the librarian got credit for the query. Recall@10 across many queries is the fraction of times the librarian got credit. The blind spot: the metric doesn't care whether the WW2 book was the first one handed over or buried at position 10, only that it showed up somewhere in the pile.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Recall@k is the metric you'll encounter first in any retrieval evaluation and the metric you'll outgrow last. It's clean, easy to compute, and easy to compare across systems. It's also incomplete in ways that matter for production decisions.
This deep dive walks through the definition, the calculation, the two main blind spots (rank ignorance and index confound), and the companion metrics that fill the gaps.
Definition and calculation
Recall@k starts with a labeled evaluation set. Each entry in the set is a pair: a query, and a list of document IDs that are known to be relevant to that query. The labels typically come from human annotation, search logs (click-through as a weak signal), or in 2026 increasingly from strong-LLM graders run over a candidate pool.
For each query, run the retrieval system and take the top-k results. Compare the top-k document IDs to the labeled relevant IDs. The query scores 1 (hit) if at least one labeled relevant ID is in the top-k, 0 (miss) otherwise.
Recall@k is the mean of these per-query scores across the evaluation set. A recall@10 of 0.85 across 100 queries means 85 queries had at least one relevant doc in their top-10 retrieval.
The metric has clean operational meaning. For a RAG pipeline that passes k=10 chunks to the LLM, recall@10 directly answers 'in what fraction of queries will the LLM see relevant context?'. That framing is what makes recall@k the right starting metric for most retrieval evals.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- BEIR benchmarks all report NDCG@10 as the primary metric, but recall@k breakouts are also published for downstream analysis.
- MTEB's retrieval category reports NDCG@10 in the headline; per-task recall@k is available in the detailed breakdown.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does measuring recall@k on an HNSW index confound embedding quality and index quality?
HNSW's recall against an exact baseline is < 1 and depends on parameters like ef_search, M, and the data distribution. If model A produces vectors that HNSW handles well and model B produces vectors that HNSW handles poorly, model A can score higher on production HNSW even if model B has better intrinsic embeddings. The way to separate is to measure both against an exact (flat) index.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Confusing recall@k with precision@k. Recall@k asks 'did at least one relevant doc make it in?' Precision@k asks 'how many of the top-k are relevant?' They measure different things and can move in opposite directions.
60 second bullets to scan on the way to the call.
Recall@k as the fraction of queries with at least one relevant doc in the top-k
Calculation walk-through (query loop, hit/miss decision, mean)
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.