Retrieval & generation · Glossary term

What is Approximate Nearest Neighbor (ANN)?

A search method that returns vectors likely to be among the nearest to a query without exhaustively comparing the query with every stored vector.

Why does Approximate Nearest Neighbor (ANN) matter?

Approximation makes large vector indexes practical, but it introduces a measurable tradeoff between search speed, memory, and retrieval recall.

Approximate Nearest Neighbor (ANN) in practice

Tune index and search parameters against a held-out query set, then report latency together with Recall@K instead of assuming every true neighbor is found.

What is the common confusion about Approximate Nearest Neighbor (ANN)?

ANN describes a search objective and tradeoff, while HNSW is one particular index algorithm that can implement it.

Learn Approximate Nearest Neighbor (ANN) in the course

No lesson links to this term yet. Search the course catalog for it.

  • Vector DatabaseA storage and indexing system that supports nearest-neighbor queries over vector representations, often with metadata filtering,…
  • HNSWAn approximate-nearest-neighbor index that organizes vectors in layered proximity graphs and searches from coarse upper layers toward…
  • Cosine SimilarityThe normalized dot product of two vectors. It compares their direction rather than their magnitude and ranges from -1 to 1 for real-valued…
  • Recall@KFor one query, Recall@K is `|relevant items intersecting the top k| / |relevant items|`.

Sources

More terms in Retrieval & generation

Open the Retrieval & generation list in the glossary

This entry comes from glossary/terms.md on GitHub. Browse all 250 glossary terms.