Skip to content

Add AI search to PostgreSQL without building the pipeline.

postvec turns a text column into searchable embeddings, keeps them current as rows change and combines keyword and meaning-based results in one SQL call. Local inference runs inside PostgreSQL by default. When models change, UniVec converters can bridge or migrate supported vectors without re-embedding the source text.

  • Local inference inside PostgreSQL
  • Automatic vector sync
  • Keyword(bm25) + semantic search
  • UniVec model conversion

PostgreSQL License (extension) · BSL 1.1 (postvec-server) · PostgreSQL 16-18 · pgvector 0.8+Local inference by default · MiniLM included · nearly 100 conversion pairs7 hosted providers · API keys stay on the inference host

Where inference runs A PostgreSQL database holding a text column and a shadow vector column, with an embedded inference engine. Optional postvec-server nodes take inference off the host over gRPC and discover each other by gossip. PostgreSQLbodytextbody_semanticvectorembedded inference local models on disk gRPCgossippostvec-serverinference nodepostvec-serverinference nodepostvec-serverinference node

Inference is embedded.

Local models embed text inside PostgreSQL. Text and inference stay on the database host.

From text column to search results, inside PostgreSQL.

Enable a column and postvec generates and keeps its embeddings up to date. Search by keyword and meaning in one SQL call, adopt vectors you already have and migrate supported vectors when your model changes.

Local setup

One container with PostgreSQL, pgvector, postvec and the bundled MiniLM model.

docker run -d --name postvec \
  -e POSTGRES_PASSWORD=demo \
  -e POSTGRES_USER=app \
  -e POSTGRES_DB=app \
  -p 127.0.0.1:5433:5432 \
  ghcr.io/univec-ai/postvec:0.5.0-2-pg18-local
sql
CREATE TABLE docs (
  id       bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  body     text,
  category text
);

SELECT postvec.enable(
  'public.docs', 'body',
  model            => 'sentence-transformers-all-minilm-l6-v2',
  create_fts_index => true
);

Declare a column semantic

Creates the shadow vector column and registers the sync. Inserts and updates queue embedding work. A background worker fills vectors after each commit.

Expected: The column appears at once; vectors fill in the background. Watch postvec.status() until pending_jobs reaches 0.

Enable guide ->

Long documents go through recursive chunking, templates control what text is sent for embedding and the SQL reference lists every function.

Build search now. Change models later.

Your embedding model will not stay the same forever. postvec brings UniVec conversion into the PostgreSQL workflow so a supported model change does not automatically mean rebuilding the whole vector store from source text.

Keep the old index searchable.

If its embedding model is no longer available, bridge new queries into that existing vector space. The stored vectors stay as they are.

Move to a new model.

When a compatible converter is available, translate the stored vectors, test retrieval quality on your data, then complete the migration.

Vector lock-in
The dependency between stored vectors and the model that produced them. postvec can translate a search query into an older model's space through a compatible converter, so the existing index can continue to serve search.
Embedding debt
The cost of changing that dependency later. postvec migrates a vector store straight into a newer model's space, using nearly 100 conversion pairs from the UniVec catalogue.

Local inference included

Swappable embedding models run locally, inside PostgreSQL or on inference nodes you operate. Raw text stays on hosts you control. Hosted providers are configured on the inference host, where their API keys are stored.

External providers

Convert stored vectors

Convert existing vectors between embedding spaces through the UniVec catalogue of nearly 100 pairs. The source text stays where it is and search continues to use the original column until you finalize the migration.

Migrate in place

Deprecated spaces keep working

Bridge search embeds the query with a local model, then converts that one vector into the stored space. An ada-002 index can serve new queries through a compatible bridge. Evaluate retrieval quality on your data.

Search a retired space

Deployment

Choose where inference runs

Run models on the database host

The extension keeps vectors in sync and runs local inference inside PostgreSQL. The bundled MiniLM model provides a starting point for semantic search.

Install the extension on a host you administer. Setup requires shared_preload_libraries and a PostgreSQL restart.

Embedded quick start
PostgreSQL + postvecInside PostgreSQLSync worker + inference

Extension: PostgreSQL License, for any use.

Open core

Open source with an optional server

The extension, the CLI, the embedded inference engine and the packages are released under the PostgreSQL License, for any use. On a self-hosted cluster, the extension alone runs the complete SQL surface.

postvec-server is a source-available companion. It moves inference into a separate process or onto a CPU and GPU fleet, adds a dashboard for model management and runs postvec on managed databases such as Amazon RDS, Cloud SQL and Supabase.

postvec-serverBUSL-1.1 · optional
  • Managed PostgreSQL
  • CPU and GPU fleets
  • Dashboard and HTTP API
  • Process isolation
postvecPostgreSQL License · open source
  • BM25 and vector search
  • Model migration
  • Sync worker
  • Embedded inference
  • External providers
  • CLI and packages
PostgreSQL 16, 17, 18with pgvector 0.8+

Made by UniVec

Postvec extension was developed by UniVec, a company building embedding inter-operability infrastructure in Dublin, Ireland. UniVec also runs a hosted embedding and conversion API which postvec can use as an external provider and offers support agreements for production deployments.

Requirements

You need PostgreSQL 16, 17 or 18 on a host where you can set shared_preload_libraries. A restart is part of first-time setup. Vectors fill asynchronously after commit. Managed databases use the server's SQL schema and external worker.

Inference runs embedded in PostgreSQL or on remote postvec-server nodes; the mode is one cluster-wide setting and the SQL is the same in both. Embedded vs remote has the trade-offs.

The extension, the CLI and their packages are under the PostgreSQL License. The bundled MiniLM model works offline; converter weights are a separate UniVec product, with a public catalogue and a larger private one for verified accounts. Release 0.5.0 is public beta.