Hierarchical Navigable Small World (HNSW)
Definition
HNSW is a graph-based index for fast approximate nearest neighbor search in vector spaces.
The index organizes vectors in multiple hierarchical neighborhood graphs. The search starts in coarse upper layers and refines in deeper layers.
Simply explained
Like a road network with highways for coarse jumps and side roads for precise target search.
Why it matters in practice
Highly relevant for semantic search, RAG, and similarity search over large embedding collections.
Example from business
A knowledge assistant uses HNSW to quickly find semantically similar passages from hundreds of thousands of document segments.
Limits and pitfalls
- Do not confuse approximation with exact search; do not test recall, memory usage, and build time; do not blindly adopt parameters; ignore filter effects.
Origin & history
Malkov and Yashunin introduced HNSW in 2016; the journal version appeared later in IEEE TPAMI.
Use in mid-sized companies
- Possible applications: vector search for RAG, similar products, duplicate detection, and semantic retrieval.
Frequently asked questions
Is HNSW exact?
No, typically approximate. What is the advantage? High search speed with good recall quality in many vector workloads.
Sources
- HNSW · Malkov & Yashunin, HNSW
- IEEE TPAMI · IEEE TPAMI
Sources checked on 10.10.2026.
Editorially reviewed on: