TL;DR
| Pinecone | Weaviate | |
|---|---|---|
| Deployment | Managed cloud only | Cloud + self-hosted |
| Search type | Pure vector similarity | Vector + hybrid (BM25) |
| Metadata filtering | Yes | Yes (more powerful) |
| Schema | Schemaless | Schema-required |
| Free tier | Yes (2GB) | Yes (Sandbox) |
| Open source | No | Yes (Apache 2.0) |
| Best for | Simplicity, scale, pure vector search | Hybrid search, complex data, control |
Use Pinecone if: You want the fastest path to production with zero infrastructure overhead and pure vector search is sufficient.
Use Weaviate if: You need hybrid search (vector + keyword), want self-hosting for data privacy, or have complex multi-modal data.
What Is a Vector Database?
Vector databases store data as numerical embeddings (vectors) and retrieve items by similarity, not by exact match. This makes them essential for RAG: you embed your documents once, then at query time, embed the question and find the closest document chunks.
Both Pinecone and Weaviate excel at this — but they take very different approaches.
Pinecone: Managed Simplicity
Pinecone is the go-to choice for teams that want to ship fast. It’s a fully managed, serverless vector database — you never touch infrastructure. The API is minimal: create an index, upsert vectors, query.
Pinecone Setup
pip install pinecone
from pinecone import Pinecone, ServerlessSpec
pc = Pinecone(api_key="your-api-key")
# Create an index
pc.create_index(
name="my-rag-index",
dimension=1536, # text-embedding-3-small output size
metric="cosine",
spec=ServerlessSpec(cloud="aws", region="us-east-1"),
)
index = pc.Index("my-rag-index")
Upsert Vectors
# Upsert with metadata
index.upsert(
vectors=[
{
"id": "doc-001",
"values": [0.1, 0.2, ...], # 1536-dim embedding
"metadata": {
"source": "manual.pdf",
"page": 3,
"text": "The API supports batch operations up to 100 vectors..."
}
},
# ... more vectors
]
)
Query
query_embedding = embed("How do I batch upsert vectors?")
results = index.query(
vector=query_embedding,
top_k=5,
filter={"source": {"$eq": "manual.pdf"}}, # metadata filter
include_metadata=True,
)
for match in results.matches:
print(f"Score: {match.score:.3f}")
print(f"Text: {match.metadata['text']}")
Pinecone with LangChain
from langchain_pinecone import PineconeVectorStore
from langchain_openai import OpenAIEmbeddings
vectorstore = PineconeVectorStore(
index_name="my-rag-index",
embedding=OpenAIEmbeddings(model="text-embedding-3-small"),
)
# Add documents
vectorstore.add_texts(["Doc 1...", "Doc 2..."], metadatas=[{"source": "a"}, {"source": "b"}])
# Search
docs = vectorstore.similarity_search("How do I query Pinecone?", k=3)
Weaviate: Flexible and Self-Hostable
Weaviate is an open-source vector database that you can run locally, on your own servers, or via Weaviate Cloud Services (WCS). Its killer feature is hybrid search — combining vector similarity with BM25 keyword matching for better retrieval quality.
Weaviate Setup
pip install weaviate-client
Local with Docker:
docker run -p 8080:8080 -p 50051:50051 cr.weaviate.io/semitechnologies/weaviate:latest
Or Weaviate Cloud:
import weaviate
import weaviate.classes as wvc
# Connect to Weaviate Cloud
client = weaviate.connect_to_weaviate_cloud(
cluster_url="your-cluster.weaviate.network",
auth_credentials=wvc.init.Auth.api_key("your-api-key"),
headers={"X-OpenAI-Api-Key": "your-openai-key"},
)
# Connect to local
client = weaviate.connect_to_local()
Define a Schema (Required in Weaviate)
Weaviate requires you to define a schema before inserting data:
from weaviate.classes.config import Configure, Property, DataType
# Create a collection
client.collections.create(
name="Document",
vectorizer_config=Configure.Vectorizer.text2vec_openai(
model="text-embedding-3-small"
),
properties=[
Property(name="text", data_type=DataType.TEXT),
Property(name="source", data_type=DataType.TEXT),
Property(name="page", data_type=DataType.INT),
],
)
Insert Data
documents = client.collections.get("Document")
with documents.batch.dynamic() as batch:
for chunk in document_chunks:
batch.add_object({
"text": chunk.text,
"source": chunk.source,
"page": chunk.page,
})
# Weaviate auto-embeds using the configured vectorizer
Query: Vector Search
result = documents.query.near_text(
query="How do I batch insert vectors?",
limit=5,
return_metadata=wvc.query.MetadataQuery(score=True),
)
for obj in result.objects:
print(f"Score: {obj.metadata.score}")
print(f"Text: {obj.properties['text']}")
Query: Hybrid Search (Weaviate’s Advantage)
# Combines vector similarity AND keyword matching
result = documents.query.hybrid(
query="batch insert vectors",
alpha=0.5, # 0 = pure keyword, 1 = pure vector, 0.5 = balanced
limit=5,
)
Hybrid search consistently outperforms pure vector search for technical queries where exact keyword matches matter (API names, error codes, version numbers).
Performance Comparison
Query Latency
Both databases achieve <100ms p99 latency for standard workloads:
| Dataset size | Pinecone (serverless) | Weaviate Cloud | Weaviate Local |
|---|---|---|---|
| 100K vectors | ~20ms | ~25ms | ~15ms |
| 1M vectors | ~35ms | ~40ms | ~30ms |
| 10M vectors | ~50ms | ~60ms | ~45ms |
For most applications, latency differences are negligible. Pinecone’s serverless has very low cold-start times.
Retrieval Quality
For standard vector search: approximately equal.
For technical/mixed queries (code snippets, API references, version numbers): Weaviate hybrid search wins by 10–20% on recall metrics.
Pricing
Pinecone
- Free tier: 5GB storage, 1M reads/month
- Serverless: ~$0.08 per 1M reads, ~$0.33 per GB/month storage
- Predictable costs for steady workloads
Weaviate
- Open source self-hosted: Free (you pay for servers)
- Weaviate Cloud Sandbox: Free for development
- Weaviate Cloud: Starts at ~$25/month for small instances
- Potentially cheaper at scale if self-hosted
At large scale (100M+ vectors), self-hosted Weaviate is typically cheaper than managed Pinecone.
Data Privacy and Compliance
Pinecone is cloud-only. Your vectors and metadata are on Pinecone’s servers (AWS/GCP). Not suitable for highly sensitive data without a Business Associate Agreement.
Weaviate can run entirely on your own infrastructure. No data ever leaves your servers. This is the decisive factor for healthcare, finance, and government use cases.
When to Use Each
Use Pinecone when:
- You want zero infrastructure management
- Your team is small and wants to ship fast
- Pure vector similarity search is sufficient for your use case
- You’re building a prototype or early-stage product
- You have predictable, moderate data volume (< 50M vectors)
Use Weaviate when:
- You need hybrid search (vector + keyword) for better retrieval quality
- Data privacy requires on-premise or private cloud deployment
- You have complex data schemas with multiple properties and data types
- You need multi-modal search (text + image)
- You want to avoid vendor lock-in with an open-source solution
- Cost at scale is a concern (self-hosted is much cheaper at 100M+ vectors)
Frequently Asked Questions
Which is easier to get started with?
Pinecone — create an account, get an API key, and you’re inserting vectors in 5 minutes. Weaviate requires Docker setup or WCS account creation, plus schema definition. For a quick RAG prototype, Pinecone’s friction-free setup wins.
Can I migrate from Pinecone to Weaviate later?
Yes, but it requires re-inserting all your data (re-embedding if you change models). Plan your data schema carefully upfront. If you might need hybrid search or self-hosting in the future, Weaviate from the start saves migration effort.
Which integrates better with LangChain and LlamaIndex?
Both have first-class integrations with LangChain (langchain-pinecone, langchain-weaviate) and LlamaIndex (llama-index-vector-stores-pinecone, llama-index-vector-stores-weaviate). The integration quality is roughly equal.
Are there other vector databases worth considering?
Yes. pgvector (PostgreSQL extension) is excellent if you’re already on Postgres — no separate infrastructure. Qdrant is a strong open-source alternative to both. Chroma is great for local development and prototyping. Milvus is popular for very large-scale deployments. Pinecone and Weaviate are the most commonly used in production AI applications as of 2025.
Does Weaviate support OpenAI embeddings natively?
Yes. Configure the text2vec-openai vectorizer module and Weaviate automatically calls the OpenAI Embeddings API at insert and query time — you never need to call the embeddings API manually.
Next Steps
- Getting Started with LlamaIndex — Use LlamaIndex with either vector database
- RAG with Pinecone — Production RAG with LangChain + Pinecone
- LlamaIndex vs LangChain for RAG — Compare RAG frameworks on top of these databases