A vector index retrieves vectors close to a query vector, often approximately, to support search by meaning rather than exact keyword overlap. Search systems use it to find documents or concepts whose embeddings are similar to the query embedding. section 13.4 section 13.5
A typical pipeline embeds corpus content and indexes the resulting vectors. At query time, it embeds the query and retrieves the k nearest vectors, which can then be ranked and presented as results. section 13.4 section 13.6.2
Semantic search for “mountain hike”
An ANN index returns semantically related hiking questions, including one about elevation gain and another about planning a trip to Rocky Mountain National Park. Similarity alone does not establish which result is most relevant; the query may lack enough context. section 13.6.2
Listing 13.17 Creating the ANN title embeddings index
import nmslib titles_index = nmslib.init(method="hnsw", space="negdotprod") normalized_embeddings = list(map(normalize_embedding, embeddings)) titles_index.addDataPointBatch(normalized_embeddings) titles_index.createIndex(print_progress=True)
This listing shows an NMSLIB HNSW index being initialized, populated with normalized embeddings, and built. section 13.6.2







