Hierarchical Navigable Small World (HNSW) is a graph-based approximate nearest-neighbor index. It connects vectors to nearby neighbors, then organizes those connections into progressively sparser layers for fast navigation. section 10.3.5
HNSW searches from coarse navigation to local precision:
- Builds a navigable small-world graph in which each vector connects to close neighbors. section 10.3.5
- Places fewer, more widely separated points in higher layers. section 10.3.5
- Traverses downward through the layers, trading retrieval speed and throughput against nearest-neighbor precision and recall. section 10.3.5 section 10.3.9
Semantic QA under resource constraints
A Haystack question-answering application used the HNSW option in Faiss to fit within a free-tier Hugging Face server. Its vector index retrieves relevant documents before a reader extracts an answer, requiring a balance among speed, RAM, and recall. section 10.3.9






