liveBook · Manning

NMSLIB

As explained in AI-Powered Search

NMSLIB is an open-source library for efficient similarity search in non-metric spaces, including approximate nearest-neighbor search.

NMSLIB is an open-source library for efficient approximate nearest-neighbor search in non-metric spaces. Its canonical HNSW implementation supports compact, practical similarity-search indexes for dense embeddings. section 13.5.4

A typical NMSLIB workflow is:

  • Normalize embeddings, add them in a batch, and commit the index with createIndex. section 13.5.4
  • Prefer offline rebuilding for read-heavy applications when write-time performance is a concern. section 13.5.4

Semantic autocomplete

An index built from 12,375 concept embeddings returns terms related to “bag,” including “bag liner,” “airbag,” and “paper bag.” Querying “mountain hike” produces close suggestions such as “mountain hiking” and “mountain trail.” section 13.5.4

How AI-Powered Search covers it

How deep it goes
Explains initialization, embedding loading, querying, filtering, and deployment trade-offs while deferring HNSW internals.
Examples
Demonstrates concept suggestions for “bag” and semantic autocomplete results for “mountain hike” and “dehyd.”
What it assumes
Assumes precomputed embeddings and normalization, while showing how to index them and encode queries.
What you can do after
Build approximate nearest-neighbor indexes with NMSLIB and query them through a Python embedding-search function.
How it connects
Connects approximate nearest-neighbor search with HNSW, dense vectors, embeddings, semantic search, and autocomplete.

Related concepts

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