What does “HNSW” mean?
A graph-based index structure for fast approximate nearest-neighbor search over high-dimensional vectors.
How HNSW Works
Top layer: few nodes, long jumps
Middle layer: more nodes, shorter jumps
Bottom layer: all vectors, fine search.
Practical Example
A search enters at the sparse top layer, hops toward the query across long links, drops a layer, and repeats, ending in the dense bottom layer with the closest vectors. It is like using highways, then streets, then your destination's block.
Why It Matters
HNSW is one of the most widely used indexes in vector databases because it gives fast, accurate searches.
Common Questions About HNSW
Q: What does HNSW stand for?
Hierarchical Navigable Small World, introduced by Malkov and Yashunin in 2016.
Q: What is the trade-off?
It uses a fair amount of memory and takes time to build the index.
Q: Can it be updated?
Yes, vectors can be added, though deleting and heavy updates need care.