HNSW builds a multi-layer graph where each node is a vector and edges connect nearby points. The top layers are sparse for fast long-range navigation; lower layers are dense for precise local search. At query time, the algorithm greedily traverses from top to bottom, narrowing in on the nearest neighbors. HNSW offers excellent recall-speed trade-offs and is the default ANN index in Pinecone, Weaviate, Qdrant, pgvector, and most other vector databases.