Glossary · Term

approximate nearest neighbor

← all terms

Definition

Plain language

Fast lookup that finds something close to what you're looking for, trading exactness for speed.

As stated in the literature

A family of indexing algorithms that retrieve approximately closest vectors under a distance metric, used in vector databases and semantic search.

Also called: ANN, nearest neighbor

Why it matters: Exact nearest-neighbor search doesn't scale, and almost every retrieval-augmented AI system depends on this approximation to be fast enough to deploy.

For example, a vector database uses approximate nearest neighbor search to fetch the dozen most similar documents to your query in milliseconds, even from a billion-document corpus.

Heard on the show

“And once you frame it that way, you reach naturally for the tools the search-engine world has been refining for thirty years — approximate nearest neighbor algorithms.”
Episode 036 — Sparse Attention Was the Wrong Frame. Treat It as Geometry Instead.

Related terms