Vector index structures: HNSW, IVF, and Flat

Exact nearest neighbor search in high dimensional spaces is O(N) in the number of vectors. At million scale, brute force is unusable. Approximate nearest neighbor (ANN) indexes trade a small recall loss for orders of magnitude speedup. Understanding the index structures is prerequisite to tuning them.