Skip to content

    Hierarchical Navigable Small World (HNSW)

    Data integration & searchHNSW, Hierarchical NSW
    Reading time: 2 min.Editorially reviewed on:
    ← All terms

    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

    Sources checked on 10.10.2026.

    Editorially reviewed on:

    On this page

    Next step

    Put knowledge into practice