Vector Indexes & Stores
How a vector index stores and searches embeddings: the index as a rebuildable copy, how HNSW finds neighbours and what ef_search changes, RAM arithmetic, and choosing a store from constraints.
Last updated
After this section you can
- Explain how an HNSW query descends the layers, and what ef_search changes
- Estimate the RAM an index needs from vector count, dimensions, precision and M, and measure the real size
- Choose a store class from workload constraints and name the trigger that would change the choice
Vector Indexes & Stores: HNSW, Recall and RAM
How an index finds neighbours fast, what recall it costs, what RAM it needs, how to pick a store.
A vector index is a rebuildable copy of your chunks: one vector each, plus a graph (HNSW, hierarchical navigable small world) that lets a query skip almost all of them. It is approximate: its recall is the share of true nearest neighbours (from an exact scan) it returns, set by ef_search and your data, and measured. It is searched from RAM, so bytes per vector times vectors sets its size.
Toy graph, not to scale. ef 4 finds 2 of 3 true neighbours in 12 distances, ef 8 all 3 in 17. Swipe to pan.