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
-
Distance metrics and when each is right
Cosine, dot product and Euclidean measure different things — except when they don't. What each compares, and why normalization collapses all three.
-
How graph indexes search
Greedy traversal over a proximity graph, why it gets stuck in local minima, and how layers and connectivity fix it — the mechanism behind HNSW.
-
How cluster indexes search
Partition the space in advance, then only search the partitions near your query. Why boundary effects cost recall and what probing more of them buys.
-
Quantization: trading memory for recall
Scalar, product and binary quantization compress vectors by discarding precision. What each one throws away, and why reranking recovers most of it.
-
The recall-latency curve
Every index parameter moves you along one curve with diminishing returns. How to measure recall honestly, and why distance concentration sets its ceiling.