pgvector Vector Search for PostgreSQL

TrialFactorial rates pgvector as Trial (2026). Subtool stores all document chunks and embeddings in pgvector and moved its retrieval off OpenAI's hosted vector store.

pgvector adds a vector column type and similarity search (cosine, inner product, L2) with HNSW and IVFFlat indexes to PostgreSQL. Embeddings live in ordinary tables, so they share transactions, backups, access control and joins with the rest of the application data.

It is the obvious choice for retrieval-augmented generation when the application already runs on PostgreSQL. Combined with PostgreSQL's full-text search it supports hybrid search without a separate search service or a managed vector database.

Updates

Trial

Subtool stores all document chunks and embeddings in pgvector and moved its retrieval off OpenAI's hosted vector store. Search is hybrid: HNSW cosine similarity plus PostgreSQL full-text search, merged by reciprocal rank fusion. Full text matters more than expected: it finds exact identifiers such as "EVB-IT" or "BITV 2.0" where embedding similarity is weak. Tenant isolation is a plain SQL filter on every query, and uploaded documents never leave our own infrastructure. One lesson: vectors from different embedding models are not comparable, so a model change means re-embedding the whole corpus.