liveBook · Manning

HNSW

As explained in Enterprise RAG

HNSW is an approximate nearest-neighbor search algorithm that uses a navigable multilayer graph to find similar vectors efficiently.

HNSW (Hierarchical Navigable Small World) is a vector-search algorithm designed to find similar vectors quickly in huge datasets. It uses additional in-memory data structures, increasing vector-index storage compared with Exhaustive KNN. section 3.1

Choose the search method according to dataset size and available memory:

  • Use HNSW when fast searches across huge datasets justify the additional index space. section 3.1
  • Use Exhaustive KNN for smaller datasets when HNSW’s memory overhead is unnecessary. section 3.1

Azure AI Search index choice

A small Azure AI Search dataset uses Exhaustive KNN with cosine similarity instead of HNSW, avoiding doubled vector-index space and extra in-memory structures. section 3.1

Figure 3.2 A correctly set-up Azure AI Search Index. Make sure to set the Retrievable, Filterable, Sortable, Facetable, and Searchable columns exactly as shown in this image.

Inspect the correctly configured Azure AI Search index and its field settings before deploying vector search. section 3.1

How Enterprise RAG covers it

How deep it goes
Explains HNSW’s performance and memory trade-off but stops short of its graph construction or search procedure.
Examples
Uses a small Azure AI Search dataset and a correctly configured vector-index figure to illustrate method selection.
What it assumes
Assumes familiarity with embeddings, vector indexes, and Azure AI Search configuration.
What you can do after
Operate/configure Azure AI Search by choosing HNSW or Exhaustive KNN and accounting for index-memory costs.
How it connects
Connects HNSW with vector indexes, embeddings, Exhaustive KNN, cosine similarity, and Azure AI Search.

Also explained in

Compare how 11 books explain HNSW →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Enterprise RAG. The section links point to the parts of the book it draws on.