AI Glossary Term
What does “ANN (Approximate Nearest Neighbor)” mean?
Definition
Algorithms that find vectors close to a query without exhaustive comparison, trading exactness for speed.
How ANN (Approximate Nearest Neighbor) works
Example
Among 100 million stored vectors, an index narrows the search to a small neighborhood and checks only those. The result is nearly the same as checking all of them, in a fraction of the time.
Why it matters
Fast similarity search is the engine of semantic search and retrieval. The speed gain costs a small chance of missing the very best match.
Common questions
How accurate is it?
Typically a high share of the true nearest neighbors, with settings to trade accuracy for speed.
Which methods exist?
Graph-based such as HNSW, clustering-based, and hashing-based approaches.
When is exact search fine?
For small collections, where comparing everything is fast enough.