pgvector

PostgreSQL extension that adds vector data types and similarity search directly inside a Postgres database.

Works with AI agents:llms.txt
Ask your AI about this, with this page as the source:ChatGPT ↗Claude ↗Perplexity ↗

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.

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.

Aix-DBAix-DB 基于 LangChain/LangGraph 框架,结合 MCP Skills 多智能体协作架构,实现自然语言到数据洞察的端到端转换。Vector DatabaseIn its code · source ↗

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.

Most loved
  • Vectors live in the Postgres you already run, so there is no second database to sync or operate. HNHN 2HN 3HN 4
  • Hybrid search is doable in plain SQL by pairing it with a BM25 implementation and rank fusion. HNHN 2
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

Reliability and open issues

Incidents on its status page50+ in the last 90 days, 15 major · 50+ in the last yearFrom its own status page, 2026-10-02. Vendors decide what they post; one page can cover several products.
Most wanted on GitHubOpen on 2026-10-04 in pgvector/pgvector, with activity in the last year — issues and feature requests by 👍.

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
Chroma → pgvector7 PRs
pgvector → Pinecone3 PRs

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 ↗