Practical thinking about AI tools and everyday work.

A vector search index trades exactness for a faster shortlist

Small colourful wooden spheres linked in a spatial network on a light desk, conceptual photographic scene.
AI-generated photographic illustration; not documentary photography.

A vector-search system does not always compare a query with every stored vector. At larger scales, it may use an approximate nearest-neighbour index to find a useful shortlist more quickly. The trade-off is that the returned set is not guaranteed to contain every neighbour an exhaustive search would have found.

The original HNSW paper by Malkov and Yashunin describes a graph-based approach with a hierarchy that helps guide the search. HNSW is one indexing method, not a synonym for embeddings or for the complete retrieval system built around them.

Keep an exact baseline for evaluation

On a manageable test collection, run an exact search using the same vectors and distance measure. Then compare the approximate result for each query. If the exact top ten contains ten particular items and the approximate top ten recovers eight of them, recall at ten for that query is 0.8. This is a simple illustrative calculation, not a reported benchmark.

Measure that alongside latency and memory use. Include queries representative of the application, rather than only convenient examples that already work. The Faiss index-selection guidance makes clear that the appropriate choice depends on requirements and available resources.

Do not confuse index recall with answer quality

An index can reproduce the exact nearest neighbours very well while the embedding model ranks unhelpful documents near the query. Conversely, a useful document may be missed before a later reranker has any opportunity to assess it. Evaluate candidate retrieval and the final user-facing answer as separate stages.

Keep filters, collection version and search settings with the results. A speed comparison is difficult to interpret if one run searches a smaller subset or uses a different similarity measure.

The practical goal is not to win a universal “fastest index” contest. It is to choose a tested operating point where the shortlist is sufficiently complete for the task and arrives within the application’s resource and response-time limits.