Nearest Neighbour

How similarity search actually finds things.

Read the blog →

You call search(), you get back ten documents, and they’re usually the right ten. Somewhere between those two facts is a piece of machinery that decided not to compare your query against most of the collection — and was right to skip them.

Nearest Neighbour is about that machinery.

What a distance metric actually measures. Why comparing against everything stops working, and at what point. How graph indexes get from a random starting node to your answer in a handful of hops. How cluster indexes carve the space up in advance, and what happens to the vectors near a boundary. What quantization throws away, and why the results survive it.

Every one of these designs is a different answer to the same question: how much accuracy will you trade for speed and memory. Once you can see that trade-off, the parameters stop being magic numbers.

Built from the naive approach upward. No papers required.

Latest posts

See all posts →