Home › Embeddings & Vector Search › Key term › ANN
Key term · Models

ANN

Fast approximate search that trades a little accuracy for a lot of speed.

In one line

ANN search finds nearly the best matches instantly instead of the exact best matches slowly.

DefinitionWhat it means

ANN, Approximate Nearest Neighbour search, is a family of algorithms, such as HNSW or IVF, that find vectors very close to a query vector without exhaustively comparing against every item in the dataset, sacrificing a small amount of accuracy for a large gain in speed. This tradeoff is what makes similarity search practical at the scale of millions or billions of embeddings.

Why it mattersWhy you should care

ANN indexing is what makes real-time semantic search and RAG retrieval feasible in production, since exact nearest-neighbor search does not scale past a modest dataset size without unacceptable latency. Engineers tune ANN parameters to balance recall against speed, and a poorly configured ANN index is a common, hard-to-diagnose source of a retrieval system missing obviously relevant results.

At a glanceSee it

ANN diagram
ANN diagram 1

The ANN Index black box is really a family of methods — trees, hashing, inverted lists, quantization, and proximity graphs — with HNSW graphs the common high-recall default.

ANN diagram 2

Inside an HNSW index the query enters at the sparse top layer and greedily hops closer, descending layer by layer to the base — where a graph gap can occasionally route the search past a true neighbor.

Where you see itIn the wild

  • HNSW or IVF index settings in a vector database config
  • Recall versus latency tradeoff charts for a search system
  • Architecture debates about scaling similarity search to billions of vectors
A living map of modern AI — kept current every morning