RAG — Vector Search
pgvector vs Pinecone vs Weaviate: 2026 Comparison
Direct answer
Use pgvector if you already run Postgres and have up to tens of millions of vectors: embeddings sit next to your data, filters and joins are plain SQL, and there's no new vendor. Use Pinecone if you want a fully managed, serverless index with no database operations (Standard starts at a $50/month minimum). Use Weaviate if built-in hybrid keyword + vector search matters or you want an open-source engine you can also buy as a managed cloud (Flex from $45/month, plus a free tier). All three are production-ready; the deciding factors are your existing stack, filtering needs and who will operate it.
Vector database choice gets argued like a religion, but for most products it is a fairly boring decision once you write down three facts: where your data already lives, how you need to filter results, and who is on call when the index misbehaves. This comparison covers pgvector, Pinecone and Weaviate on the points that actually change outcomes, with pricing taken from each vendor's own pages rather than from memory.
Key facts, with sources
- pgvector supports HNSW and IVFFlat indexes; the vector type can be indexed up to 2,000 dimensions and halfvec up to 4,000 dimensions. (pgvector README)
- In pgvector, filtering with approximate indexes is applied after the index is scanned; starting with version 0.8.0, iterative index scans keep scanning until enough matching rows are found. (pgvector README)
- Pinecone's Standard plan has a $50/month minimum, with storage at $0.33/GB/month, writes at $4–$4.50 per million units and reads at $16–$18 per million units depending on cloud and region; Starter is free up to 2 GB. (Pinecone pricing, Oct 2026)
- Weaviate Cloud offers a free plan (100,000 objects, 1 collection) and a pay-as-you-go Flex plan starting at $45/month, billed mainly on stored vector dimensions. (Weaviate pricing, Oct 2026)
The comparison at a glance
All three store embeddings and return nearest neighbours fast enough for interactive search. The differences are in where they live, how they filter, and how much operational work they push onto your team.
| pgvector | Pinecone | Weaviate | |
|---|---|---|---|
| What it is | Postgres extension | Managed vector database (serverless) | Open-source vector database + managed cloud |
| Index types | HNSW, IVFFlat | Managed (not user-tuned) | HNSW, flat, dynamic |
| Filtering | Plain SQL WHERE + joins | Metadata filter operators | Structured filters on properties |
| Hybrid keyword + vector | DIY (Postgres full-text + vectors) | Supported with sparse vectors | Built in (hybrid query, alpha weight) |
| Multi-tenancy | Row-level security / schemas | Namespaces | Native multi-tenancy |
| Who operates it | You (or your managed Postgres) | Pinecone | You (self-host) or Weaviate Cloud |
| Entry price | Your existing Postgres | Free Starter; Standard $50/mo minimum | Free plan; Flex from $45/mo |
pgvector: the default when you already run Postgres
If your users, documents and permissions already live in Postgres, pgvector removes an entire system from the architecture. Embeddings are a column, permissions are the same WHERE clause you already use, and a document deletion removes its vectors in the same transaction — no sync job between two databases that can drift apart.
Use an HNSW index for most workloads: it gives better recall-versus-speed than IVFFlat and doesn't need a training step. Watch the dimension limits — a 3,072-dimension embedding won't index as vector, so either store it as halfvec (indexable up to 4,000 dimensions) or use a model with fewer dimensions. Size memory for the index: HNSW is fastest when the index fits in RAM.
CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE chunks (
id bigserial PRIMARY KEY,
tenant_id uuid NOT NULL,
document_id uuid NOT NULL REFERENCES documents(id) ON DELETE CASCADE,
content text NOT NULL,
embedding vector(1536) NOT NULL
);
-- Cosine distance index (operator <=>)
CREATE INDEX ON chunks USING hnsw (embedding vector_cosine_ops);
CREATE INDEX ON chunks (tenant_id);
-- Keep scanning until enough rows pass the filter (pgvector 0.8.0+)
SET hnsw.iterative_scan = relaxed_order;
SELECT id, content, embedding <=> $1 AS distance
FROM chunks
WHERE tenant_id = $2
ORDER BY embedding <=> $1
LIMIT 8;The filtering gotcha that bites every vector store
Approximate indexes find the nearest neighbours first and filter second. pgvector's documentation says this directly: with approximate indexes, filtering is applied after the index is scanned. If a tenant owns 1% of the rows and the index returns its usual candidate set, very few candidates survive the tenant filter and you get three results when you asked for eight — or none.
There are a few fixes. In pgvector 0.8.0 and later, iterative index scans keep searching until enough rows pass the filter. For very selective filters, a plain B-tree index on the filter column with an exact scan can be faster and fully accurate, which the README also recommends for conditions that match a low percentage of rows. For many large tenants, partitioning by tenant keeps each index small. Managed databases handle this internally, but you should still test recall with your real filters rather than unfiltered benchmarks.
Pinecone: managed, serverless, nothing to tune
Pinecone's appeal is that there is no database to run. You create an index, upsert vectors with metadata, and query; capacity and index tuning are the vendor's problem. Namespaces give cheap per-tenant isolation, and metadata filters cover the usual equality, range and set operators.
The trade-offs are the ones of any separate system: your source of truth still lives in your main database, so you need a reliable sync path for creates, updates and deletes, and joins with relational data happen in application code. Pricing is usage-based on top of a monthly minimum, so it suits teams that value zero operations over squeezing the last dollar out of a database they already pay for.
import os
from pinecone import Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
index = pc.Index("docs")
index.upsert(
vectors=[
{
"id": "doc-42#3",
"values": embedding,
"metadata": {"document_id": "doc-42", "lang": "en", "updated": 1761177600},
}
],
namespace="tenant-7",
)
results = index.query(
vector=query_embedding,
top_k=8,
namespace="tenant-7",
filter={"lang": {"$eq": "en"}},
include_metadata=True,
)Weaviate: hybrid search built in, open source or managed
Weaviate's strongest argument is search quality features out of the box. Hybrid search combines keyword (BM25) and vector scores in one query, with an alpha parameter that shifts the weight between them — useful when users search for exact product codes, names or error messages that pure vector search handles poorly. It also has native multi-tenancy and can call embedding models for you at import time.
Because the engine is open source, you can start on Weaviate Cloud and later self-host, or the reverse, without changing query code. The cost of that flexibility is another system to learn and, if self-hosted, to operate.
import weaviate
from weaviate.classes.query import Filter
client = weaviate.connect_to_weaviate_cloud(
cluster_url=WEAVIATE_URL,
auth_credentials=weaviate.auth.AuthApiKey(WEAVIATE_API_KEY),
)
docs = client.collections.get("Chunk")
response = docs.query.hybrid(
query="refund for expired card",
alpha=0.5, # 0 = keyword only, 1 = vector only
limit=8,
filters=Filter.by_property("lang").equal("en"),
)
for obj in response.objects:
print(obj.properties["content"])
client.close()What it costs: a worked sizing example
Start from raw size. One million chunks with 1,536-dimension float32 embeddings is 1,000,000 × 1,536 × 4 bytes, about 6.1 GB of vectors before any index overhead or metadata. Halving precision with halfvec in pgvector roughly halves that.
On pgvector, the cost is the Postgres instance that can hold that index comfortably in memory — often the database you already pay for, sometimes one size up. On Pinecone, storage for a few GB is a small line item next to the $50 Standard minimum; read units become the main cost as query volume grows. On Weaviate Cloud, billing follows stored vector dimensions above the Flex starting price, with the free plan covering small prototypes up to 100,000 objects. For most products under a few million vectors, the database bill is smaller than the embedding and LLM bill — pick on operations and features, not on storage price.
| Scenario | Lean towards | Why |
|---|---|---|
| MVP, data already in Postgres | pgvector | No new system, SQL filters, one transaction |
| Small team, no DB on-call, spiky traffic | Pinecone | Serverless, nothing to tune |
| Users search exact codes, names, errors | Weaviate | Hybrid keyword + vector in one query |
| Strict data residency / self-host required | pgvector or Weaviate | Both can run in your own infrastructure |
| Hundreds of millions of vectors | Benchmark all three | Sharding, cost and recall need real tests |
When to hire senior help
Vector search is easy to start and hard to run well at scale, so bring in senior help when recall problems, filtered-query slowdowns, or index rebuild windows start affecting production, since these usually trace to index and schema decisions made early. An experienced engineer can also prevent the expensive mistake of migrating databases when the real problem is chunking or embedding quality. If your stack includes React Native + Python + AI, a senior engineer who owns the full product beats coordinating multiple juniors.
Bottom line
Dhairya Senjaliya ships RAG — Vector Search projects worldwide — book a scoping call to discuss your specific situation.
Common pitfalls to avoid
- ✕Adopting a dedicated vector database before checking whether pgvector on the Postgres already in your stack meets scale needs at a fraction of the operational cost.
- ✕Benchmarking only latency and ignoring recall, then shipping an ANN index tuned so aggressively it silently misses relevant documents.
- ✕Discovering metadata filtering requirements late, since filtered vector search behaves very differently across engines and can collapse recall or throughput.
- ✕Upgrading embedding models without budgeting a full re-embed, or worse, mixing embeddings from different models in the same index.
Frequently asked questions
Is pgvector good enough for production RAG?
Yes for most products. With an HNSW index sized to fit in memory, pgvector serves interactive search over millions of vectors, and keeping embeddings next to relational data simplifies permissions and deletes. Benchmark with your real filters before going past tens of millions of vectors.
Why are my filtered vector searches returning too few results?
Approximate indexes filter after scanning, so selective filters discard most candidates. In pgvector, enable iterative index scans (0.8.0+), use an exact scan with a B-tree index for very selective filters, or partition by tenant.
Do I need hybrid search?
If users search for exact strings — product codes, names, error messages, legal citations — usually yes, because pure vector search can miss exact matches. Weaviate has it built in; with pgvector you combine Postgres full-text search with vector scores yourself.
Can I switch vector databases later?
Yes, if you keep your source documents and chunking pipeline outside the vector store. Re-embedding and re-indexing is a batch job; what's hard to migrate is business logic that leaks into vendor-specific query features.
Does the vector database affect answer quality?
Less than most people expect. Chunking, embedding model choice, re-ranking and filters usually matter more. Recall differences between well-configured databases are small compared with a bad chunking strategy.
Do we need a dedicated vector database or is pgvector enough?
Published benchmarks show Postgres with pgvector and pgvectorscale matching or beating dedicated services at 50-million-vector scale at roughly a quarter of the cost, and it keeps vectors next to your relational data. Dedicated databases earn their place at billions of vectors, strict multi-tenant isolation, or when your team lacks Postgres operations capacity.
What does vector search cost at our scale?
Embedding a million average-sized chunks costs only a few dollars with current embedding APIs; the real cost is serving, where managed vector databases commonly run hundreds to thousands of dollars per month at tens of millions of vectors. Self-hosted Postgres benchmarked around 75% cheaper than a managed alternative at the 50-million-vector mark.
How do we choose HNSW parameters?
Higher m and ef_construction improve recall at the cost of build time and memory, and higher ef_search trades queries per second for recall at query time. Tune against a ground-truth set built from your own data, targeting 95% to 99% recall, rather than copying defaults from a benchmark run on different data.
Bottom line: Dhairya Senjaliya ships RAG — Vector Search projects worldwide. Book a scoping call at https://dhairyasenjaliya.com/#book-call.