pgvector
PostgreSQL extension that adds vector data types and similarity search directly inside a Postgres database.
86 open-source projects declare pgvector in their code; 1 maker's product we track uses it. What makers like most: Vectors live in the Postgres you already run, so there is no second database to sync or operate. Their most common complaint: Latency degrades at very large vector counts, which per-chunk or patch embeddings reach quickly. On GitHub, 16 public pull requests moved projects to pgvector from tools we list, and 3 moved them away.
Profile checked
Works with AI agents:llms.txtHow makers use pgvector
Makers' products we track use pgvector for vector database (1).
What pgvector is used for
pgvector vs the alternatives makers chose
For vector database, 1 of the 107 makers' products we know the choice of picked pgvector (1%), behind Pinecone (50%).
| Option | Makers' products | Free for | At 10,000 users | Open source | |
|---|---|---|---|---|---|
| 53 50% | ~3,300 users | $113/mo · Standard | No | ||
| 18 17% | ~1,000 users | $103/mo · Standard (3 nodes, 0.5 vCPU / 4 GiB each) | Yes | ||
| 16 15% | ~1,000 users | $253/mo · Flex | Yes | ||
| 12 11% | ~760 users | $51/mo · Starter | Yes | ||
| 8 7% | None | $21/mo · Launch | No | ||
| 3 3% | — | — | Yes | ||
| 1 1% | — | — | Yes |
For vector database: how many of the 107 makers' products we know the vector database of chose each option, and what each costs at 10,000 users.
Costs are the cheapest plan that fits, from each vendor's pricing page, at the usage our stack planner assumes for a product with that many users. Free for: the users its cheapest plan a business can use stays free for.
When to use pgvector, and when not
Pick pgvector if
- You already use Postgres and have up to a few million vectors. Vector Database →
Something else fits better if
- You're prototyping retrieval on your laptop, or want vectors in files with no server: Chroma.
- You want a hosted index with nothing to operate: Pinecone or turbopuffer.
- You need an open-source store with heavy filtering or hybrid search, self-hosted or managed: Qdrant or Weaviate.
pgvector 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.
More about pgvector
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.
pgvector pros and cons
What makers like most: Vectors live in the Postgres you already run, so there is no second database to sync or operate. Their most common complaint: Latency degrades at very large vector counts, which per-chunk or patch embeddings reach quickly.
Pros
Cons and watch-outs
- 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
Themes that recur in makers' words and Hacker News comments, each linked to what it summarises.
Reliability and open issues
The most wanted open issue on GitHub has 11 👍.
Most wanted on GitHub
- Are either int8 or fp8 vectors planned?👍 11 · opened Apr 2024 · active Aug 2026
Who switches
More projects move to pgvector: 16 pull requests in, 3 out; the most come from Qdrant and leave for Pinecone.
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
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.
Who uses it
1 makers' products, each linked to the source that shows it, and 86 open-source projects that declare it in their code.
None of these in makers' own words.
Open source: a project that declares pgvector as a dependency in its public code — verifiable, but not necessarily a live product.
What its projects tell coding agents
43 of the 60 open-source products built with pgvector that were worked on in the last 180 days keep instruction files for coding agents — 72%, against 53% of all the projects we read. AGENTS.md is in 32, CLAUDE.md in 30.
Alternatives to pgvector
All alternatives by situation →Further reading
Questions makers ask about pgvector
What is pgvector used for?
PostgreSQL extension that adds vector data types and similarity search directly inside a Postgres database. Makers' products we track use it for vector database (1).
What are the pros and cons of pgvector?
Pros makers name: Vectors live in the Postgres you already run, so there is no second database to sync or operate. Hybrid search is doable in plain SQL by pairing it with a BM25 implementation and rank fusion. Cons: Latency degrades at very large vector counts, which per-chunk or patch embeddings reach quickly. Index size and dimension limits make ultra-wide embeddings awkward, forcing quantization or split vectors. Heavy vector workloads compose badly with other workloads on the same database server.
What are the alternatives to pgvector?
For vector database, the other options makers' products we track chose most are Pinecone (53), Qdrant (18), Weaviate (16), Chroma (12), turbopuffer (8), LanceDB (3). Open source or self-hostable among them: Qdrant, Weaviate, Chroma, LanceDB. Each alternative, with the situation it fits, is on the pgvector alternatives page.
Do developers switch to or away from pgvector?
On GitHub, 16 public pull requests moved projects to pgvector from tools we list, most from Qdrant (9), Chroma (7); 3 moved them away, most to Pinecone (3).
When should you use pgvector?
You already use Postgres and have up to a few million vectors (vector database). Something else fits better if: you're prototyping retrieval on your laptop, or want vectors in files with no server, pick Chroma; you want a hosted index with nothing to operate, pick Pinecone or turbopuffer.
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?
1 makers' products we track, each with a source, and 86 open-source projects declare it in their code. source ↗