🕸️

HNSW Index

Builds a navigable graph · jumps node-to-node to find the nearest neighbor fast

HNSW builds a graph where each vector is a node. Search starts at entry node A and greedily hops to whichever neighbor is most similar and stops when no neighbor is better.

Flow: 🚪 Start at A 🔍 Compare neighbors 🏃 Move to best 🏆 Done
🎯

Query Vector

Editable
📍

Node Vectors

Editable

Edit node values. similarity scores update live. New nodes connect to the last existing node.

🕸️

Graph Visualization

Unvisited Visited Current Done

Connections: A↔B, A↔C, B↔D, C↔D, C↔E, D↔F, E↔F

A B C D E F
Press "Start Search" to begin the greedy graph traversal.
Visited
0
Comparisons
0
FLAT checks
6

💡 Key Idea

Follows best-path through a graph. Like GPS navigation, skips dead ends, finds nearest fast.

✅ Best For

High-speed search, large in-memory datasets, low latency.

Graph traversal, not clustering. HNSW builds layers of navigable graphs and jumps node-to-node toward the nearest neighbor.
It's one of the fastest approximate methods available, widely used in production vector databases.
The trade-off is higher memory use for the graph structure, and index construction can be slower than simpler methods.
💡
Key Takeaway

HNSW searches by hopping across a navigable graph instead of scanning vectors, delivering very fast approximate search at the cost of extra memory.