Recall@K is defined as the ratio of true nearest neighbors found in the top K retrieved results to the total number of true nearest neighbors in the ground truth set. It quantifies the accuracy loss introduced by approximate nearest neighbor (ANN) algorithms compared to exact brute-force search, where a score of 1.0 indicates perfect retrieval of all relevant items.
Glossary
Recall@K

What is Recall@K?
Recall@K is a standard evaluation metric for information retrieval and approximate nearest neighbor search that measures the fraction of relevant items successfully retrieved within the top K results.
This metric is critical for tuning the recall-speed tradeoff in vector indexes like HNSW or IVF, where higher K values or relaxed search parameters increase recall at the cost of latency. Unlike precision, Recall@K ignores irrelevant results, focusing solely on completeness—making it the primary metric for ensuring a re-ranking pipeline receives all necessary candidates.
Key Characteristics of Recall@K
Recall@K is the primary metric for quantifying the accuracy loss introduced by approximate search. It measures the fraction of true nearest neighbors captured within the top K retrieved results.
Core Definition
Recall@K = |Retrieved True Neighbors ∩ Top-K Results| / |All True Neighbors|
- K is the number of results returned to the user or downstream system
- True Neighbors are the ground-truth results from an exact brute-force search
- A score of 1.0 means perfect recall—all true neighbors were found
- A score of 0.8 at K=10 means 2 out of 10 true neighbors were missed
Why It Matters for ANN
Approximate Nearest Neighbor algorithms trade accuracy for speed. Recall@K quantifies this tradeoff directly.
- Without Recall@K, you cannot objectively compare HNSW vs. IVF vs. DiskANN
- A 10x speedup is worthless if Recall@10 drops from 0.99 to 0.65
- Production systems typically target Recall@10 > 0.95 for semantic search
- The metric exposes regression bugs when re-indexing or tuning hyperparameters
Recall vs. Latency Tradeoff
The fundamental engineering tension in vector search:
- Higher recall requires searching more graph edges or Voronoi cells
- Lower latency requires aggressive pruning and smaller search scopes
- Typical tuning parameters that affect this balance:
ef_searchin HNSW: larger values increase recall but slow searchnprobein IVF: more probes increase recall linearly with compute
- Plotting a recall-latency curve is standard practice for index selection
K-Dependent Behavior
Recall@K is highly sensitive to the choice of K:
- Recall@1: Measures whether the single most relevant item was found. Critical for question-answering systems.
- Recall@10: Standard benchmark for search result pages. Balances precision and recall.
- Recall@100: Used for re-ranking pipelines where a coarse filter feeds a precise downstream model.
- Recall@1000: Relevant for exhaustive retrieval tasks like e-discovery or deduplication.
Always report Recall@K at multiple K values to fully characterize an index.
Ground Truth Generation
Computing Recall@K requires exact nearest neighbors as ground truth:
- Run brute-force k-NN search over the entire dataset using the same distance metric
- For billion-scale datasets, this is computationally prohibitive
- Sampling strategies: evaluate recall on a representative query subset
- Approximate ground truth: use a highly-accurate but slow ANN config (e.g., HNSW with very high ef_search) as a proxy
- Mismatched distance metrics between ground truth and ANN index invalidate the measurement
Common Pitfalls
Avoid these errors when measuring Recall@K:
- Ignoring tied distances: vectors at identical distances can cause non-deterministic ordering, inflating or deflating recall
- Measuring on training queries: always use a held-out query set to avoid overfitting
- Single K reporting: Recall@10 alone hides poor Recall@1 performance
- Ignoring filtered ANN: recall with metadata filters is a distinct, harder problem requiring separate measurement
- Confusing Recall@K with Precision@K: recall measures completeness; precision measures relevance ratio
Frequently Asked Questions
Clear, technical answers to the most common questions about the Recall@K evaluation metric, its calculation, and its role in benchmarking approximate nearest neighbor search systems.
Recall@K is a standard evaluation metric that measures the fraction of true nearest neighbors successfully retrieved within the top K results returned by an approximate search algorithm. It quantifies the accuracy loss introduced by trading exact computation for speed. The metric works by comparing the set of K items returned by an Approximate Nearest Neighbor (ANN) index against the ground truth set of true nearest neighbors, typically pre-computed via brute-force search. If a query has 10 true nearest neighbors and the ANN index returns 8 of them in its top-10 results, the Recall@10 is 0.8. This metric is the primary gauge of index quality, directly measuring how much recall is sacrificed to achieve lower latency and memory consumption.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Understanding Recall@K requires familiarity with the core algorithms, complementary metrics, and fundamental trade-offs in approximate search.
Approximate Nearest Neighbor (ANN) Search
The algorithmic paradigm that Recall@K evaluates. ANN algorithms trade a small, quantifiable loss in accuracy for massive speedups, making search feasible in high-dimensional spaces where exact brute-force is computationally prohibitive.
Precision@K
A complementary metric often used alongside Recall@K. While Recall@K measures the fraction of true neighbors found, Precision@K measures the fraction of retrieved items that are actually relevant. The two metrics are often balanced in a precision-recall trade-off.
Brute-Force Search
The exact, ground-truth benchmark against which Recall@K is calculated. A brute-force scan computes the distance to every vector in the database, guaranteeing 100% recall at the cost of O(N) time complexity, which is impractical for large-scale production systems.
Re-ranking
A two-stage pipeline that directly optimizes the recall-latency trade-off. A fast ANN index retrieves a large candidate set with high Recall@K, and a slower, precise Cross-Encoder re-scores only those candidates to boost final precision without sacrificing the initial recall.
Quantization Error
The primary source of recall degradation in compressed indices. Product Quantization (PQ) and Scalar Quantization (SQ) reduce memory by approximating vectors, introducing distortion. Higher compression ratios increase this error, directly lowering Recall@K unless compensated by searching more candidates.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us