ef search
The HNSW query setting for how many candidate vectors the search keeps while walking the graph; higher finds more true neighbours but runs slower.
In more detail
Its build-time sibling, ef construction, sets how hard the index searches for good links when inserting. Tune both by measuring recall at k and latency on your own queries, including filtered ones.
Related terms
- HNSW — An approximate vector index built as a layered graph of links between nearby vectors, searched by walking from a coarse top layer down to a dense bottom one.
- recall at k — The share of the relevant passages for a query that appear in the top k results.
Taught in
- Vector Indexes And Databases — AI Engineering: LLM Apps, RAG & Agents
References
- Malkov and Yashunin: Hierarchical Navigable Small World graphs (arXiv 1603.09320)
- pgvector README: distance operators