A series on finding neighbors in high-dimensional vector spaces, the algorithms behind modern retrieval systems, and what UMAP and semantic search have in common.
Almost every modern AI application depends on nearest-neighbor search over high-dimensional vectors. A semantic search query turns into an embedding and asks the index "what's near me?" A recommender asks the same question about a user's latent vector. A dimensionality-reduction method like UMAP builds its whole output from a graph of nearest neighbors. The primitive is everywhere.
But when you try to do this at scale, every naive approach breaks. Exact search becomes too slow. Distances stop being informative. Data stops fitting in memory. The state of the art is a tower of clever workarounds, and the fact that it works at all is a small miracle.
This series builds intuition for how modern ANN systems work. Not through code listings or pseudocode proofs, but through figures you can play with until the tradeoffs feel obvious. The through-line is that modern ANN is three ideas stacked on top of each other:
Production systems like FAISS and lancedb stack all three. We will build up to that stack one layer at a time, starting in two dimensions where everything is still visible. Then we follow the primitives into two very different destinations: UMAP, which uses them to build a skeleton of local structure for dimensionality reduction, and semantic search, which uses them to retrieve documents at query time.
Why exact nearest-neighbor search breaks in high dimensions, and why approximation is the only way forward.
The first idea: cut the vector space into regions so every query only looks at the regions that could possibly contain neighbors.
The second idea: replace full-precision vectors with small codes that are dozens of times smaller and still let you estimate distance.
The third idea: the winning index depends on where the data lives. RAM, SSD, and GPU reward very different layouts.
Two destinations for the same primitive. UMAP uses nearest neighbors to build structure; semantic search uses them to retrieve answers.