pgvector
PostgreSQL extension that adds a vector type plus exact and approximate (HNSW, IVFFlat) nearest-neighbour search.
pgvector lets you store embeddings next to your relational data and query them with SQL, joins and transactions. HNSW and IVFFlat indexes provide approximate search, and half-precision, binary and sparse vectors reduce storage. It is available on most managed Postgres services, so many teams can add vector search without a new database.
- Type
- Library
- Category
- AI & ML
- Maintainer
- Andrew Kane and contributors
- First released
- 2021
- License
- Open source (PostgreSQL)
- Pricing
- Open source
- Level
- Intermediate
- Technologies
- postgresql, sql, vector-database, rag
- GitHub stars
- 23,937
- Weekly downloads
- 10,447,608 (pypi)
- Last verified
- 26 Nov 2026
What pgvector is used for
- Adding RAG to an existing Postgres app
- Hybrid relational + vector queries
Strengths
- No extra database to operate
- Full SQL and transactions
- Widely available on managed Postgres
Limitations
- Very large-scale vector workloads may outgrow a single Postgres
- Index tuning needed
pgvector alternatives
How it relates to other tools
- pgvector built on PostgreSQL
- pgvector works with LangChain
- pgvector works with LlamaIndex
- pgvector works with Sentence Transformers