HNSW (Hierarchical Navigable Small World)
Also known as: Hierarchical Navigable Small World
A graph-based ANN index with log-time approximate search, excellent recall/latency trade-off.
An approximate nearest neighbor index that builds a multi-layer graph where higher layers act as expressways for fast greedy search. The dominant ANN algorithm for in-memory vector search at scale.
In practice
Most production vector stores (FAISS, Qdrant, Weaviate, Pinecone) use HNSW under the hood. Expect questions on its M, efConstruction, and ef params.
How it compares
HNSW is one ANN index algorithm; vector databases are the systems that bundle it with storage and APIs.
Related topics
Related terms
Retrieval-Augmented Generation (RAG)
Fetch relevant docs at inference time and stuff them into the prompt so the model can answer from real data.
Embeddings
Dense numeric vectors that capture meaning; close vectors = similar text.
Vector Database
A database tuned for fast approximate nearest-neighbor search over millions of high-dimensional vectors.
Chunking
Cutting documents into retrievable pieces before embedding them.
Context Window
The max number of tokens a model can attend to at once.
Hallucination
When a model confidently makes up something that isn't true.