Skip to main content
Learn about HNSW parameters and how they affect performance.

Parameter Reference

M (Max Connections)

Controls the number of connections each node has in the graph.
src/hnsw-m-param.ts

M Impact

efConstruction

Controls build-time quality. Higher values = better graph structure but slower indexing.
src/hnsw-ef-construction.ts

efConstruction Impact

efSearch

Controls search-time quality. Can be adjusted per-query:
src/hnsw-ef-search.ts

efSearch Impact

Configuration Presets

src/hnsw-presets.ts

Full Configuration Example

src/hnsw-full-config.ts

HNSW Overview

Introduction to HNSW

HNSW Tuning

Tune for your use case

Search Performance

General performance tips