AI Glossary Term
What does “HNSW” mean?
Definition
A graph-based index structure for fast approximate nearest-neighbor search over high-dimensional vectors.
How HNSW works
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
What does HNSW stand for?
Hierarchical Navigable Small World, introduced by Malkov and Yashunin in 2016.
What is the trade-off?
It uses a fair amount of memory and takes time to build the index.
Can it be updated?
Yes, vectors can be added, though deleting and heavy updates need care.