HNSW vs IVF vs Flat: Vector Indexes Tested on 100k Vectors
I searched 100,000 vectors by looking at about 500, and still found nearly every right answer.
Video #49 ยท RAG and vector search
Steps in the video
Files
- compare.py (42 lines)
- data.py (13 lines)
Tested with
Python 3.12.15 | faiss-cpu==1.15.0
What this does not show
100,000 made-up clustered vectors of 64 numbers and 200 queries, one seeded run; work is counted in comparisons, not time, and the IVF count leaves out the 316 group comparisons; adding, deleting and filtering were not tested.
Sources
Learning IT by Example.