What is it?
If you already use PostgreSQL, pgvector lets you add "search by meaning" without a new database: store each item's embedding in a column and ask for the closest ones using normal SQL.
Also known as: pgvector, postgres vector search, postgres embeddings, HNSW index postgres, IVFFlat, vector column postgres, semantic search in postgres, pgvector vs pinecone.
Technical definition
The extension provides vector types and distance operators (L2, inner product, cosine) with exact scan and ANN indexes (HNSW, IVFFlat). Benefits: transactional consistency, joins, filters and existing operations tooling; trade-offs: memory use of indexes, recall/speed tuning and scaling characteristics versus specialised systems. Version features (e.g. half-precision, sparse or binary vectors) change; check current docs and your managed-Postgres provider's support.
Entity type: database · Freshness class: volatile.
When should I use it?
Good first choice when already on Postgres and scale is moderate.
Implementation patterns
- Embeddings column beside the source row; filter with SQL then order by distance.
- HNSW index for recall/latency balance.
- Combine with Postgres full-text search for hybrid retrieval.
- Keep the embedding model/version in a column.
Technologies and frameworks
Commonly associated: PostgreSQL, pgvector, HNSW / IVFFlat, managed Postgres services. Names are examples of what exists, not recommendations, and projects change quickly.
Practical guide
- Enable the extension.
- Choose vector dimension from your embedding model.
- Insert embeddings.
- Create an ANN index.
- Measure recall vs latency.
Common failure modes
- No index at scale (slow sequential scans).
- Index memory exceeding RAM.
- Mixing embedding models in one column.
- Recall loss from aggressive ANN settings.
Troubleshooting
- Slow similarity queries — Add an HNSW/IVFFlat index and tune search parameters.
- Results missing relevant rows — Increase ef_search/probes; verify filters do not over-prune.
Contrasted with
- What is a Vector Database? — Dedicated vector databases specialise in scale and features; pgvector keeps vectors with your relational data.
Questions this page answers
- What is pgvector?
- How do I store embeddings in PostgreSQL?
- pgvector vs a dedicated vector database?
- How do I create an HNSW index in Postgres?
Typical goals: add vector search to an existing Postgres app; choose between pgvector and a vector database.
Sources and verification
Status: not independently verified. This entry was authored on 2026-10-06 from general technical knowledge, without live checking of the sources below. Treat every source as a lead to confirm (identifier, title, authorship, current version) before publication or citation.
Freshness class: volatile — Products, versions, protocols, benchmarks, leaderboards, regulations and dates. Verify against the primary source before relying on specifics; re-review every 3 months.
Time-sensitive claims to verify before relying on them:
- Supported versions, index types and managed-service availability.
Canonical sources (unverified leads):
- pgvector repository and documentation — github.com/pgvector/pgvector
- Malkov & Yashunin, Efficient and robust approximate nearest neighbor search using HNSW (2016) — arXiv:1603.09320