# Approximate Nearest Neighbor (ANN)

> A fast search for close vectors that may miss a few of the very best.

**Field:** Artificial Intelligence  
**Category:** Retrieval & Search  
**Also known as:** ANN Search, Approximate k-NN

## Think of it like

Think of it like you only check the streets near your house, not the whole town. You still find the closest shop.

## Definition

Approximate nearest neighbor search finds vectors very close to the query, without checking every one. It uses an index to look only where a match is likely. It is much faster, but it may miss a few of the true best ones. Good settings still find well over 90 percent of them. Most vector databases work this way.

## Example

Emma searches 10 million vectors. Checking all of them takes seconds. With an approximate index, it takes a few milliseconds and finds 97 of the true top 100.

## Why it matters

It is what makes vector search fast enough to run while a person waits.

## Common mistake

Tuning only for speed. Push it too far and the right text drops out of the results without any error.

## Three principles

- **Skips most vectors.** Looks where it is likely.
- **Speed for a little accuracy.** A fair trade.
- **Tune and measure.** Check what it misses.

## Related terms

- [Nearest Neighbor Search](https://learn.benibix.com/term/ai/nearest-neighbor-search)
- [Vector Index](https://learn.benibix.com/term/ai/vector-index)
- [Hierarchical Navigable Small World (HNSW)](https://learn.benibix.com/term/ai/hierarchical-navigable-small-world)

![Two bars. Exact search checks every one of a million vectors and is slow. Approximate search checks a small part, is far faster, and still finds most of the true closest ones.](https://learn.benibix.com/diagrams/rt-ann.svg)

---

Source: https://learn.benibix.com/term/ai/approximate-nearest-neighbor
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
