What does “ANN (Approximate Nearest Neighbor)” mean?
Algorithms that find vectors close to a query without exhaustive comparison, trading exactness for speed.
How ANN (Approximate Nearest Neighbor) Works
ANN (Approximate Nearest Neighbor) comparing Exact search (Compare query to every vector, Slow at scale) versus Approximate search (Use an index to skip most vectors, Very fast, tiny chance of a miss).
Practical 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 About ANN (Approximate Nearest Neighbor)
Q: How accurate is it?
Typically a high share of the true nearest neighbors, with settings to trade accuracy for speed.
Q: Which methods exist?
Graph-based such as HNSW, clustering-based, and hashing-based approaches.
Q: When is exact search fine?
For small collections, where comparing everything is fast enough.