Skip to main content

Module pgvector

Module pgvector 

Source
Expand description

pgvector AsyncVectorIndex (feature pgvector) — PostgreSQL + pgvector ext. pgvector AsyncVectorIndex — PostgreSQL + the pgvector extension.

PgVectorIndex implements AsyncVectorIndex over a sqlx::PgPool, mirroring qdrant/elastic (async remote vector backend). Vectors live in a {table}(id BIGINT PK, vec <type>) relation; search uses the cosine distance operator <=>. Requires CREATE EXTENSION vector in the target DB (the table + HNSW index are created automatically by PgVectorIndex::new).

Two precisions: newvector (float32, dim ≤ 2000), new_halfvechalfvec (float16, ~half RAM, dim ≤ 4000; needs pgvector ≥ 0.6).

Structs§

PgVectorIndex
PostgreSQL vector index backed by the pgvector extension.
PgVectorOpts
Storage precision + HNSW tuning for PgVectorIndex.