pgvector
pgvector is a self-hosted database in the Retrieval & Vector Stores layer of the AI stack. Vector similarity search as a Postgres extension.
By Kunj ShahFacts verifiedmethod
- Licence
- PostgreSQL
- Language
- SQL
- Cost
- free
- Owned by
- Data & Retrieval
Use pgvector when
Under a few million vectors, or when retrieval joins rows you already have.
Skip pgvector when
Vector search has become the workload rather than a side feature.
Holds the embeddings, returns the few that matter. See every retrieval tool.
Badge this entry
[](https://lattice.kunjshah.in/retrieval-vector-stores/pgvector)Rules of thumb
- Most bad retrieval is a ranking or chunking problem, not a database problem. Fix the eval set and the chunks before you migrate stores.
- Test filtered recall, not just recall. Metadata filters are where vector stores differ most and where demos never look.
- Use the database you already run until it measurably fails. A second datastore is a second thing to back up, secure and page on.
Quick answers
- Is pgvector open source?
- Yes. pgvector is open source under the PostgreSQL licence. It is free to use.
- What are the alternatives to pgvector?
- The closest alternatives to pgvector are Qdrant, Milvus and Weaviate.
Ask an AI about this page
Opens the assistant with this page’s link and a question already filled in.
Compared in
- pgvector vs Qdrant vs Pinecone vs ChromaVector stores compared on hybrid search, filtering, operational burden and when the honest answer is that you should not add one at all.
- Retrieval vs fine-tuning vs prompt optimisation: fixing wrong answersThree layers that each claim to fix wrong answers, compared on what they actually change, what they need from you, and which failure each one is for.
Reading on retrieval
- When not to use a vector databaseBad retrieval is usually a ranking or chunking problem wearing a database costume. Fix those first, and the store you already run often turns out to be enough.
- Fix the ranking, not the promptWhen a RAG system gives a bad answer, the instinct is to rewrite the prompt. Nine times out of ten the prompt is fine and the context was never there.
Alternatives to pgvector
compare 3 →Listed as an alternative to
- QdrantQdrantRust vector database with rich filtering payloads.Apache-2.0 · self-hosted · free
Use when Vector-first workloads with heavy metadata filtering at scale.
Skip when You want no new datastore to operate.
- ChromaChromaEmbeddings database designed for fast prototyping.Apache-2.0 · self-hosted · free
Use when Getting a prototype working in an afternoon.
Skip when You need durability, scaling or concurrent writes.
- MilvusMilvusCloud-native vector database supporting billion-scale indexes.Apache-2.0 · self-hosted · free
Use when Billion-scale indexes with a cloud-native deployment.
Skip when You need a small, comprehensible system.
Also in retrieval
- QdrantQdrantRust vector database with rich filtering payloads.Apache-2.0 · self-hosted · free
Use when Vector-first workloads with heavy metadata filtering at scale.
Skip when You want no new datastore to operate.
- WeaviateWeaviateGraph-aware vector database with hybrid and multi-vector search.BSD-3-Clause · self-hosted · free
Use when Hybrid or multi-vector search with a graph-shaped data model.
Skip when Your data is genuinely relational and joins matter more than vectors.
- ChromaChromaEmbeddings database designed for fast prototyping.Apache-2.0 · self-hosted · free
Use when Getting a prototype working in an afternoon.
Skip when You need durability, scaling or concurrent writes.
- PineconePineconeFully managed vector database with serverless scaling.proprietary · saas · usage-based
Use when Zero operational work, and vector search is not your core competence.
Skip when Residency, cost predictability or a query language you control.
- MilvusMilvusCloud-native vector database supporting billion-scale indexes.Apache-2.0 · self-hosted · free
Use when Billion-scale indexes with a cloud-native deployment.
Skip when You need a small, comprehensible system.
- TurbopufferTurbopufferVector search engine tuned for high-recall retrieval workloads.proprietary · saas · usage-based
Use when High-recall retrieval at volume, without operating the index yourself.
Skip when You need to tune the index directly.
- UnstructuredUnstructuredPreprocessing library that partitions raw documents for indexing.Apache-2.0 · self-hosted · free
Use when Partitioning messy documents into retrievable chunks before indexing.
Skip when Your input is already structured.
- ElasticsearchElasticsearchBM25 plus dense vectors in one index, with hybrid ranking.Elastic-License-2.0 · self-hosted · usage-based
Use when One index carrying BM25 and dense vectors, with ranking you can tune.
Skip when You need a permissive licence: the Elastic licence is not OSI-approved.
- VespaVespaSearch engine built for ranking-heavy retrieval at scale.Apache-2.0 · self-hosted · free
Use when Ranking-heavy retrieval where the ranking function is the product.
Skip when You want a small, low-operations component.
- RerankersRerankersPurpose-built cross-encoders for the second retrieval stage.proprietary · saas · usage-based
Use when A cross-encoder in the second retrieval stage, to lift precision cheaply.
Skip when You have no way to measure whether recall actually improved.
- Jina AIJina AIMultimodal embeddings and a reranker behind one endpoint.proprietary · saas · usage-based
Use when Multimodal embeddings and a reranker behind one endpoint.
Skip when Embeddings must stay in-house.
- LangChain Text SplittersLangChain Text SplittersDocument loaders and splitters for the ingest stage.MIT · self-hosted · free
Use when Document loaders and splitters, if you are already in that ecosystem.
Skip when Structure matters: fixed-size splitting is rarely the right boundary.
- DoclingDoclingLayout-aware parsing that preserves table and heading structure.MIT · self-hosted · free
Use when Layout-aware parsing that preserves tables and heading structure.
Skip when Your documents are plain text.
- LlamaParseLlamaParseManaged parsing for PDFs, especially the ugly ones.proprietary · managed · usage-based
Use when Managed parsing for PDFs, especially the ugly ones.
Skip when Document contents cannot leave your infrastructure.