PgVectorOptions
Defined in: pgvector.vector-store.ts:42
HNSW index tuning knobs.
mandefConstructionare build-time parameters baked into the index and trade index build cost for recall/latency.efSearchis the query-time search breadth; higher values improve recall at the cost of latency. It is applied viaSET hnsw.ef_searchbefore each search. Under transaction-pooled connections (e.g. PgBouncer transaction mode) the GUC may not persist, so prefer session pooling when tuning it.
Properties
Section titled “Properties”efConstruction?
Section titled “efConstruction?”
optionalefConstruction?:number
Defined in: pgvector.vector-store.ts:46
HNSW ef_construction (build-time candidate list size). pgvector range 4-1000.
efSearch?
Section titled “efSearch?”
optionalefSearch?:number
Defined in: pgvector.vector-store.ts:48
HNSW hnsw.ef_search (query-time candidate list size). >= 1.
optionalm?:number
Defined in: pgvector.vector-store.ts:44
HNSW m (max connections per layer). pgvector range 2-100.