pgvector is an open-source extension that adds vector similarity search to PostgreSQL, so you can keep embeddings in the same database as the rest of your data.
In plain words
Instead of running a separate vector database, you install pgvector in Postgres and give a table a column of type vector. A query can then sort rows by how close their embedding is to a query vector, using distances such as cosine or L2. For speed on large tables it offers two approximate index types, HNSW and IVFFlat. Because it is plain Postgres, you keep transactions, joins, backups and every other Postgres feature.
A quick example
The project's docs show a table called items with an embedding column. A query orders the rows by distance to a short example vector and returns the closest five, and a WHERE clause can limit the search to one category at the same time.
Where you'll meet it
- Adding semantic search to an existing Postgres app.
- Retrieval for RAG without a separate database.
Related
Sources
- Docspgvector/pgvector, pgvector (GitHub) · read 29 Sept 2026
- Docspgvector 0.8.0 Released!, PostgreSQL · read 29 Sept 2026
Checked by WhatIsAI against the sources above · 29 Sept 2026. Spotted an error? Report it.