Skip to content

pgvector vector store

PostgreSQL with the pgvector extension, selected via VECTOR_STORE_PROVIDER=pgvector. It is the reference vector store and the default.

Enable it

bash
VECTOR_STORE_PROVIDER=pgvector

pgvector reads no connection env vars of its own. It reuses the backend's existing Postgres database and sync psycopg2 connection, so there is nothing extra to configure.

Configuration

VariableDefaultDescription
VECTOR_STORE_PROVIDERpgvectorLeave as pgvector to use this store.

Notes

  • This is the reference implementation and the only store exercised against a real server. Every other provider is functionally partial and unit-tested against a mocked client.
  • It natively covers the whole engine surface: hybrid BM25 keyword search (ts_rank) and SQL-side bi-temporal filtering.
  • Tenancy is enforced in SQL: every row carries org_id/project_id, and query methods scope by an optional (org_id, project_id) so one tenant can never read another's memories.
  • Tables are created on first use, with an HNSW ANN index for semantic search. On pgvector versions older than 0.5 the HNSW index is skipped (a warning, not a failure), leaving searches as sequential scans.
  • reconcile_vector_dims runs once at startup: on an embedder/dimension switch it NULLs stale vectors and widens the column, keeping rows and payload text for re-embedding on the next write.

The memory layer for AI agents.