Homeglossary

Recall at K

Recall at K is a retrieval evaluation metric that measures the share of all relevant items returned in the top K results. In machine learning, search, recommendations, and retrieval-augmented generation, it shows whether a system is finding enough of the information it should find. It does not measure whether irrelevant results also appear or whether relevant results rank first.

Build better-retrieving AI apps with Emergent.

What Is Recall at K?

Recall at K, also written Recall@K, measures the share of all relevant items found in the top K results. It evaluates ranked results from search engines, recommendation systems, code search, and retrieval-augmented generation, or RAG. A relevant item helps answer a query, and K is the number of top-ranked results checked. Recall@K does not measure irrelevant results or whether a useful item ranks first.

How to Calculate Recall at K

Calculate the score using a known set of relevant results for each query.

  1. Define the documents, code files, products, or chunks relevant to a test query.
  2. Retrieve and rank results, then keep the first K items.
  3. Count relevant items in those results. These are true positives.
  4. Divide that count by all known relevant items. If a RAG question has four supporting chunks and the top five contain three, Recall@5 is 3 divided by 4, or 0.75.

Relevant items not retrieved are false negatives, which lower recall.

Recall at K vs Precision at K vs Hit Rate

These metrics answer different questions about ranked retrieval.

MetricDenominatorQuestion answeredBest use
Recall@KAll relevant itemsDid the system find enough relevant results?RAG, semantic search, code search
Precision@KK retrieved itemsHow clean are the top results?Search and recommendations
Hit@KOne query outcomeDid at least one relevant item appear?Single-answer lookup tasks

Recall@K treats a relevant item at rank 1 the same as one at rank K, so it does not reward better ordering within the window.

Benefits of Recall at K for Search and RAG Evaluation

Recall is useful when missing source material could produce an incomplete answer.

  • It identifies relevant documents or chunks a retriever misses.
  • It helps teams tune embeddings, query rewriting, filters, and candidate limits.
  • It supports evaluation for recommendations, semantic search, code search, and RAG.
  • It makes retrieval testing concrete before evaluating generated answer quality.

Practical Limits of Recall at K

A strong score does not guarantee a good user result.

  • It depends on complete, accurate relevance labels, which can be difficult for broad queries.
  • Increasing K can raise recall simply by returning more items.
  • It ignores ordering among relevant items within K.
  • High recall can add noisy context, slow retrieval, and use excess model tokens.

Choosing K and Reading the Score

Choose K based on the results a user sees or the chunks a downstream model can use well. Report several values, such as Recall@3, Recall@5, and Recall@10. Segment results by query type, and pair recall with precision and answer-quality checks. This approach helps when planning app design and development for AI features.

Recall at K in Emergent Apps

Teams building AI-powered search, knowledge bases, recommendation features, or RAG workflows in Emergent can define relevant test results before measuring Recall@K. This creates a repeatable way to validate retrieval as an app evolves. Explore related concepts in the Emergent glossary, then use recall with user testing to improve AI retrieval.

Start Building
on Emergent today
Start Building