pgvector
Database / data tool · Free
A PostgreSQL extension for vector search: it stores embeddings alongside ordinary tables and adds neighbor-search indexes.
Also known as: pgvector/pgvector; postgres-vector; similarity-search-extension

What you can use for free
Installing the extension and running vector queries in your own PostgreSQL.
Paid features and costs
Self-hosting requires compute resources and storage. Managed PostgreSQL and external embedding generation may have separate paid plans or free terms from the chosen provider; the pgvector license does not pay for them or require purchasing these services.
Access and limitations
Installing the extension and running vector queries in your own PostgreSQL. Self-hosting requires compute resources and storage. Managed PostgreSQL and external embedding generation may have separate paid plans or free terms from the chosen provider; the pgvector license does not pay for them or require purchasing these services.
Use cases
- Add embedding search to PostgreSQL
- Load vectors and check a nearest-neighbor query with the required index
Example workflow
A possible workflow; this is not a report of hands-on testing.
Add embedding search to PostgreSQL.
Before you start
- A schema, test dataset, and queries.
- A supported database or runtime.
Steps
- Define a vector column and document embedding source.
- Load vectors and check a nearest-neighbor query with the required index.
- Check schema changes, indexes, and data recovery.
Check your result
- Query results match the reference data.
- Check access permissions, backup recovery, and load before production use.
Choosing pgvector
Add embedding search to PostgreSQL
Choose this when
- Add embedding search to PostgreSQL
- Load vectors and check a nearest-neighbor query with the required index
Requirements
- Enable the extension with CREATE EXTENSION vector in every required database. To use an index, the query needs ascending ORDER BY on the distance operator and LIMIT.
Things to consider
- Costs and limits of free use: Self-hosting requires compute resources and storage. Managed PostgreSQL and external embedding generation may have separate paid plans or free terms from the chosen provider; the pgvector license does not pay for them or require purchasing these services.
- Terms of use: PostgreSQL License: a permissive extension license, not MIT.
- With approximate search, WHERE applies after the index scan: results may contain fewer rows. Iterative scan broadens the search until enough rows are found or the configured limit is reached.
Frequently asked questions
What can you use for free in pgvector?
Installing the extension and running vector queries in your own PostgreSQL.
What additional costs might arise with pgvector?
Self-hosting requires compute resources and storage. Managed PostgreSQL and external embedding generation may have separate paid plans or free terms from the chosen provider; the pgvector license does not pay for them or require purchasing these services.
What terms of use matter for pgvector?
PostgreSQL License: a permissive extension license, not MIT.
How do you get started with pgvector?
Define a vector column and document embedding source. Load vectors and check a nearest-neighbor query with the required index. Check schema changes, indexes, and data recovery.
How do exact search and HNSW/IVFFlat indexes differ in pgvector?
Search is exact by default. HNSW builds a graph without training; IVFFlat trains on data and divides vectors into lists. Approximate indexes accelerate queries at the cost of recall; search parameters control this tradeoff.
License
PostgreSQL License: a permissive extension license, not MIT.
Custom license — this product's terms apply
The license name does not imply standard MIT or GPL rights. Its own text determines permission to modify, work commercially, distribute, and use outputs. Follow the use case stated for the product above and the primary source for its terms.
Technologies and topics
- pgvector
- database
- Development