pgvector
PostgreSQL extension that adds vector data types and similarity search directly inside a Postgres database.
Works with AI agents:llms.txtpgvector is a PostgreSQL extension that lets you store embeddings in an ordinary table column, next to the rows they describe, and find the nearest ones with SQL. Instead of running a separate vector store and keeping IDs in sync between two systems, vectors live in the same database as your users, documents and permissions.
You enable it with CREATE EXTENSION vector, add a vector(n) column, and order a query by a distance operator (cosine, L2, inner product and others) with a LIMIT. Without an index Postgres compares every row and returns exact results; adding an HNSW or IVFFlat index switches to approximate search, which is faster but can return slightly different rows. Any language with a Postgres client works, and the project keeps helper libraries for Python, Node.js, Ruby, Go, Rust, Java and many more.
What a small team gets is Postgres itself: transactions, JOINs and WHERE clauses in the same query, plus WAL replication and point-in-time recovery. It also offers half-precision, binary and sparse vector types, and pairs with Postgres full-text search for hybrid queries. It runs anywhere Postgres 13+ runs (Docker, Homebrew, apt), and many hosted Postgres providers ship it preinstalled.
The limits: indexes cover up to 2,000 dimensions (4,000 with half precision); filters on an approximate index are applied after the index scan, so selective filters can return fewer rows unless you turn on iterative scans; and scaling beyond one machine means read replicas or a sharding tool such as Citus.
Where it fits
Who uses it
No maker's live product on record yet, and 70 open-source projects that declare it in their code.
We haven't found a maker's live product that uses pgvector yet — only the open-source projects below, which declare it in their code.
Open source: a project that declares pgvector as a dependency in its public code — verifiable, but not necessarily a live product.
Loved and watch-outs
Themes that recur in makers' words and Hacker News comments, each linked to what it summarises.
- Latency degrades at very large vector counts, which per-chunk or patch embeddings reach quickly. HNHN 2HN 3
- Index size and dimension limits make ultra-wide embeddings awkward, forcing quantization or split vectors. HNHN 2
- Heavy vector workloads compose badly with other workloads on the same database server. HNHN 2
Reliability and open issues
- minor Actions Job Delays Oct 2026
- minor Elevated request latency Oct 2026
- minor [Retroactive] Actions workflow run failures after deployment gate approvals Oct 2026
- Are either int8 or fp8 vectors planned?👍 11 · opened Apr 2024 · active Aug 2026
Who switches
Public pull requests on GitHub since Oct 2024 whose title says "X to Y" — real code changes moving a project from one tool to another, by developers in general. Open a row to see the pull requests.
Qdrant → pgvector9 PRs
- Refactor vector storage from Qdrant to Supabase pgvectorunais-08/docs-query-RAG · 2026-09-23
- Feature/qdrant to pgvectorahmedeldamaty20/mini-rag · 2026-08-23
- migrated from qdrant to pgvectorJrahimin/rag-builder · 2026-07-16
- feat(brain): move the vector store from Qdrant to Supabase pgvectorwildlifeai/ww-website · 2026-07-09
- Change from qdrant vector db to postgres pgvectorKicaRonaldOkello/chat_pdf · 2026-07-07
- Migrate from Qdrant to pgvector: update configurations, remove Qdrant references, and adjust indexing logicnandinigthub/Knowledge-hunt · 2026-07-06
- feat: drop Qdrant — migrate fully to PGVector + PGVector semantic cachesuncirkles/nexus-learner · 2026-04-15
- Migrate from Qdrant to PostgreSQL pgvector for vector storagedx-junkyard/episteme-graph · 2026-03-23
- Migrate vector database from Qdrant to pgvectorLucasgarciamdz/tesis-entrenai · 2025-05-21
Chroma → pgvector7 PRs
- LOT 27 P3 — audit Chroma to pgvector data mappingcyranoaladin/RAG · 2026-07-15
- feat(db): migrate Chroma embeddings to pgvectoryaronsha/photo-app · 2026-05-22
- Chroma to pgvector migration scriptNYU-ITS/NAGA-open-webui · 2025-12-05
- Chroma to pgvector migration scriptNYU-ITS/NAGA-open-webui · 2025-12-04
- Revert "Revert "Chroma to pgvector migration script""NYU-ITS/NAGA-open-webui · 2025-12-02
- Revert "Chroma to pgvector migration script"NYU-ITS/NAGA-open-webui · 2025-12-01
- Chroma to pgvector migration scriptNYU-ITS/NAGA-open-webui · 2025-11-24
pgvector → Pinecone3 PRs
- feat: migrate vector search from Supabase pgvector to Pinecone serverlesscmtemkin/needham-navigator · 2026-02-20
- Refactor notebook 05: migrate from pgvector to Pinecone architecturealiomraniH/billing-model · 2025-12-13
- changed pgvector to pinecone v-db & restructured codeharikrishnan51688/NewsNeuron · 2025-08-04
Alternatives to pgvector
All alternatives by situation →Questions makers ask about pgvector
Is pgvector available on hosted Postgres?
Many hosted Postgres providers include it, and the README links to a maintained list of them. It also comes preinstalled in Postgres.app and has packages for Docker, Homebrew, apt and yum. source ↗
Can I index embeddings with more than 2,000 dimensions?
Not with the standard vector type. Half-precision vectors or half-precision indexing reach 4,000 dimensions, binary quantization reaches 64,000, and you can also index subvectors or reduce dimensionality. source ↗
Does the vector index have to fit in memory?
No, but queries are faster when it does. Half-precision indexing or binary quantization make the index smaller. source ↗
Are replication and point-in-time recovery supported?
Yes. pgvector writes through the Postgres write-ahead log, so standard replication and point-in-time recovery cover vector data too. source ↗
Why does a filtered query return fewer results after I add an HNSW index?
With approximate indexes the filter runs after the index scan, so only part of the candidates match. Since version 0.8.0 you can enable iterative index scans to keep scanning until enough rows are found, or add a regular index on the filter column. source ↗
Can I combine keyword and vector search?
Yes. Use it alongside Postgres full-text search and merge the two result lists, for example with Reciprocal Rank Fusion or a cross-encoder. source ↗
How should I handle many tenants in one table?
Tenants sharing one approximate index can affect each other's recall and speed. For isolation the README suggests list partitioning by tenant or separate tables. source ↗
Is pgvector free?
Yes — it is free, open-source software.
Is pgvector open source or self-hostable?
Open source, and you can self-host it. source ↗
Can AI coding agents work with pgvector?
It serves an llms.txt docs index.
Who uses pgvector?
No maker's live product we track yet; 70 open-source projects declare it in their code. source ↗