Skip to content
unlob

What is Approximate nearest neighbour (ANN)?

Verified 5 August 2026

Exact nearest-neighbour search is linear in the corpus size. ANN algorithms make it sublinear by restricting the search: inverted-file methods cluster vectors and search only the nearest clusters, while graph methods build a navigable structure and walk it greedily.

The recall-speed trade is tunable. Searching more clusters or exploring more of the graph improves recall at the cost of latency, which means the same index can serve a fast path and a thorough path.

Common questions

What is Approximate nearest neighbour (ANN)?

ANN search finds vectors close to a query vector without guaranteeing the exact closest, trading a small recall loss for orders-of-magnitude speed improvement.

How does Approximate nearest neighbour (ANN) work in practice?

The recall-speed trade is tunable. Searching more clusters or exploring more of the graph improves recall at the cost of latency, which means the same index can serve a fast path and a thorough path.

See it working

The free tier is 10,000 requests a month with no card — enough to test any of this against your own queries.