
Open-source vector similarity search for Postgres
By Tanmay Verma, Founder · Last verified 29 May 2026
Affiliate disclosure: We earn a commission when you use our links. Editorial picks are independent. How we choose.
If you’re already on Postgres and need vector search without adding a separate system, pgvector is a no-brainer. It’s production-ready, free, and supports multiple vector types and distance metrics. Just be aware that HNSW indexing can be memory-heavy for massive datasets.
Last verified: May 2026
pgvector is the gold standard for adding vector search to Postgres. If you’re building a recommendation engine, semantic search, or any AI feature where vectors live alongside relational data, this is the simplest path. It’s free, open-source, and backed by a thriving community (21.5k stars on GitHub). The key advantage is that you avoid syncing data to a separate vector database — you get immediate consistency, backups, and JOINs. For most teams with up to tens of millions of vectors, pgvector’s HNSW index is fast enough. However, if you’re dealing with billions of vectors or need specialized vector operations (e.g., cosine similarity with a dedicated ANN index), alternatives like Pinecone or Weaviate may offer better raw performance. Also, pgvector lacks built-in client-side vector generation — you’ll need to compute embeddings separately. Real-world caveats: building an HNSW index can consume significant RAM, and the IVFFlat index requires training data. For hybrid search (filtering + vector), you must rely on Postgres’s own filtering, which can be slower than custom systems. But for 90% of use cases — semantic search, RAG, recommendations — pgvector is the right call.
Skip pgvector if Skip pgvector if you need a fully managed vector database with automatic scaling, sub-10ms latency at millions of vectors, or GPU-accelerated indexing.
How likely is pgvector to still be operational in 12 months? Based on 6 signals including funding, development activity, and platform risk.
pgvector is an open-source PostgreSQL extension that enables vector similarity search directly within your database. It stores vectors alongside your existing data, eliminating the need for a separate vector database. Designed for developers and data scientists, it supports exact and approximate nearest neighbor search with multiple distance functions including L2, inner product, cosine, L1, Hamming, and Jaccard distances. pgvector handles single-precision, half-precision, binary, and sparse vectors, and offers ACID compliance, point-in-time recovery, JOINs, and all other PostgreSQL features. It can be installed via Docker, Homebrew, PGXN, or compiled from source on Linux, Mac, and Windows. The extension also provides indexing via HNSW and IVFFlat, with quantization support for scalability. Compared to standalone vector databases, pgvector leverages Postgres's mature ecosystem, reducing operational complexity and enabling powerful hybrid queries combining vectors with relational data.
Tell us what you want to build — we'll match the AI tools that fit your goal, budget & existing stack.
Concrete scenarios for the personas pgvector actually fits — and what changes day-one when you adopt it.
You have a Postgres database of support documents. After generating embeddings with an LLM, you store them in a vector column and run similarity searches to retrieve relevant context for each user query.
Outcome: The chatbot returns accurate, context-aware answers with sub-second retrieval latency.
You store product embeddings in a Postgres table alongside price, category, and stock. You query for similar products within a price range using cosine distance and a relational WHERE clause.
Outcome: You deliver personalized product recommendations without maintaining a separate vector database.
You have an existing Postgres-backed web app. You add a vector column to the articles table, generate embeddings for each article, and let users search by natural language.
Outcome: Search results improve dramatically—users find content by meaning, not just keywords.
pgvector's performance is bounded by the underlying Postgres instance. Approximate nearest neighbor search may not match the speed of purpose-built vector databases. The extension does not provide managed infrastructure, replication, or scaling out-of-the-box—all that is left to the user's Postgres deployment. HNSW index builds can be slow on large datasets, and there is no native GPU acceleration or custom distance function support.
Project the real annual outlay, including the implied monthly cost when only an annual tier is published.
Vendor list price only. Add-on usage, seat overages, and contract minimums are surfaced under Hidden costs & gotchas.
For each published pgvector tier: who it actually fits, and what it adds vs. the previous tier. Cross-reference the cost calculator above for projected annual outlay.
Open Source
$0
Ideal for
Any developer, startup, or enterprise that wants free vector search integrated into Postgres without per-vector or per-query costs.
What this tier adds
Free and open-source—no paid tiers. All features (HNSW, IVFFlat, all distance metrics, all vector types) are included without restriction.
The company stage and team size where pgvector's pricing actually pencils out — and where peers do it cheaper.
pgvector is free and open-source. For teams already paying for a Postgres instance, the additional cost is zero. This makes it far cheaper than managed vector databases like Pinecone ($70+/month starting) or Weaviate Cloud (usage-based). The trade-off is you manage the infrastructure yourself.
How long it actually takes to get something useful out of pgvector — broken out by persona, not the marketing-page minute.
Installation takes about 10 minutes for a developer familiar with Postgres: clone the repo, make install, and CREATE EXTENSION vector. Adding a vector column and running your first similarity query is another 15 minutes. For teams using Docker or a hosted provider, it can be as quick as adding a single line to your Dockerfile or enabling the extension in the provider's dashboard.
How to bring data in from common predecessors and how to get it back out — written for the switcher, not the buyer.
Pricing, brand, ownership, or deprecation changes worth knowing before you commit. Most-recent first.
Open-source vector similarity search for Postgres. Contribute to pgvector/pgvector development by creating an account on GitHub.
Open-source vector similarity search for Postgres. Contribute to pgvector/pgvector development by creating an account on GitHub.
Used pgvector? Help shape our editorial sentiment research.
© 2026 RightAIChoice. All rights reserved.
Built for the AI community.
Last calculated: May 2026
Open-source vector similarity search for Postgres. Contribute to pgvector/pgvector development by creating an account on GitHub.
Durable execution platform for crash-safe AI agents and workflows.