Skip to main content
← All Articles · · 13 min read

Vector Databases Explained: Pinecone vs Weaviate vs Qdrant vs Chroma (2026 Guide)

A complete comparison of the best vector databases in 2026: Pinecone, Weaviate, Qdrant, Chroma, and pgvector. Pricing, code examples, performance benchmarks, and a clear decision framework for AI and LLM applications.

aivector-databasellmembeddingspineconeqdrant

Vector Databases Explained: Pinecone vs Weaviate vs Qdrant vs Chroma (2026 Guide)

Every serious AI application built in the last two years has the same infrastructure question: where do you store your embeddings, and how do you query them fast enough to matter?

Vector databases have gone from niche research infrastructure to a core piece of the modern AI stack. If you’re building a RAG pipeline, a semantic search feature, a recommendation engine, or any application that uses embeddings from models like OpenAI, Cohere, or local models via Ollama, you need to make this choice.

This guide compares the five most important options in 2026 — Pinecone, Weaviate, Qdrant, Chroma, and pgvector — with real code examples, honest pricing breakdowns, and a clear framework for picking the right one for your use case.

What Is a Vector Database?

A vector database stores high-dimensional numerical vectors (embeddings) and retrieves them using approximate nearest neighbor (ANN) search rather than exact key lookups.

When an LLM or embedding model processes text, images, or audio, it produces a vector — typically 768 to 3072 floating point numbers — that encodes semantic meaning. Two pieces of content with similar meaning will have vectors that are “close” to each other in this high-dimensional space.

Vector databases are optimized to answer the question: given this query vector, what are the N most similar vectors in my collection?

This is fundamentally different from what a relational database like PostgreSQL does. Traditional databases excel at exact matches and range queries. Vector databases excel at fuzzy semantic similarity at scale.

Why This Matters for LLM Applications

The dominant pattern for production LLM apps in 2026 is Retrieval-Augmented Generation (RAG):

  1. Embed your knowledge base (documents, FAQs, product data) at ingestion time
  2. When a user asks a question, embed the query
  3. Retrieve the most semantically similar chunks from your vector store
  4. Pass those chunks as context to the LLM
  5. The LLM answers using retrieved context rather than hallucinating

The vector database is the engine behind step 3. Its speed, recall accuracy, and cost directly determine your app’s quality and economics.

The Contenders at a Glance

DatabaseTypeBest ForFree TierOpen Source
PineconeManaged cloudProduction, no-ops2GB storageNo
WeaviateHybrid (cloud + self-hosted)Hybrid search, multimodalCloud sandboxYes
QdrantHybrid (cloud + self-hosted)High performance, Rust1GB cloudYes
ChromaSelf-hosted / embeddedLocal dev, prototypingUnlimited localYes
pgvectorPostgreSQL extensionExisting Postgres stackUnlimited localYes

Pinecone

Pinecone is the fully managed vector database that trades control for simplicity. You create an index, insert vectors, and query — no infrastructure to think about.

Pricing (2026)

  • Starter (Free): 2GB storage, 1 project, shared infrastructure, ~100K vectors at 1536 dimensions
  • Standard: $0.096 per GB-month storage + $0.10 per million read units
  • Enterprise: Custom pricing, dedicated infrastructure, SLA guarantees

Real-world cost: a production RAG app with 1M document chunks at 1536 dimensions costs roughly $18-35/month on Standard, depending on query volume.

Code Example: Insert and Query with Pinecone

from pinecone import Pinecone, ServerlessSpec
import openai

pc = Pinecone(api_key="YOUR_PINECONE_API_KEY")
openai_client = openai.OpenAI(api_key="YOUR_OPENAI_API_KEY")

# Create an index
pc.create_index(
    name="my-docs",
    dimension=1536,  # text-embedding-3-small output size
    metric="cosine",
    spec=ServerlessSpec(cloud="aws", region="us-east-1")
)

index = pc.Index("my-docs")

# Generate embeddings for documents
def embed(texts: list[str]) -> list[list[float]]:
    response = openai_client.embeddings.create(
        model="text-embedding-3-small",
        input=texts
    )
    return [item.embedding for item in response.data]

# Insert vectors
documents = [
    {"id": "doc-1", "text": "Vector databases store embeddings for semantic search"},
    {"id": "doc-2", "text": "RAG pipelines retrieve context before LLM generation"},
]
embeddings = embed([d["text"] for d in documents])

index.upsert(vectors=[
    {"id": doc["id"], "values": emb, "metadata": {"text": doc["text"]}}
    for doc, emb in zip(documents, embeddings)
])

# Query
query = "how do AI apps retrieve relevant context?"
query_vector = embed([query])[0]

results = index.query(
    vector=query_vector,
    top_k=5,
    include_metadata=True
)

for match in results["matches"]:
    print(f"Score: {match['score']:.3f} | {match['metadata']['text']}")

Pros and Cons

Pros: Zero infrastructure, excellent developer experience, consistent performance at scale, strong SDK support.

Cons: No self-hosting option, pricing can escalate, data leaves your infrastructure, limited filtering compared to competitors.


Weaviate

Weaviate is an open-source vector database with a rich feature set: hybrid search (combining vector and BM25 keyword search), multi-tenancy, multimodal support, and a GraphQL query interface.

Pricing (2026)

  • Open Source: Free, self-hosted, unlimited
  • Weaviate Cloud Sandbox: Free, 14-day sandbox clusters for development
  • Serverless: $0.095 per million vector dimensions stored per month + $0.015 per million queries
  • Dedicated: From $65/month for dedicated clusters

Code Example: Insert and Query with Weaviate

import weaviate
from weaviate.classes.init import Auth
from weaviate.classes.config import Configure, Property, DataType
from weaviate.classes.query import MetadataQuery
import openai

client = weaviate.connect_to_weaviate_cloud(
    cluster_url="YOUR_WEAVIATE_URL",
    auth_credentials=Auth.api_key("YOUR_WEAVIATE_API_KEY"),
)

openai_client = openai.OpenAI(api_key="YOUR_OPENAI_API_KEY")

# Create a collection
client.collections.create(
    name="Document",
    vectorizer_config=Configure.Vectorizer.none(),  # we supply our own vectors
    properties=[
        Property(name="text", data_type=DataType.TEXT),
        Property(name="source", data_type=DataType.TEXT),
    ]
)

collection = client.collections.get("Document")

# Insert documents with embeddings
documents = [
    {"text": "Vector databases store embeddings for semantic search", "source": "guide"},
    {"text": "RAG pipelines retrieve context before LLM generation", "source": "guide"},
]

def embed(text: str) -> list[float]:
    response = openai_client.embeddings.create(
        model="text-embedding-3-small", input=text
    )
    return response.data[0].embedding

with collection.batch.dynamic() as batch:
    for doc in documents:
        batch.add_object(
            properties={"text": doc["text"], "source": doc["source"]},
            vector=embed(doc["text"])
        )

# Hybrid search: vector + keyword combined
results = collection.query.hybrid(
    query="AI context retrieval",
    vector=embed("AI context retrieval"),
    limit=5,
    return_metadata=MetadataQuery(score=True)
)

for obj in results.objects:
    print(f"Score: {obj.metadata.score:.3f} | {obj.properties['text']}")

client.close()

Pros and Cons

Pros: Hybrid search is best-in-class, open source with active community, rich GraphQL API, built-in multi-tenancy.

Cons: More complex to set up than Pinecone, GraphQL syntax has a learning curve, resource-heavy for small deployments.


Qdrant

Qdrant is a Rust-native vector database focused on performance and correctness. It offers the best ANN benchmark numbers in the field and a clean REST/gRPC API. The team ships thoughtfully — fewer features than Weaviate, but what it does it does extremely well.

Pricing (2026)

  • Open Source: Free, self-hosted via Docker or binary
  • Qdrant Cloud Free: 1GB storage, 1 cluster (no credit card required)
  • Qdrant Cloud Paid: From $9/month per cluster (1 vCPU, 1GB RAM, 4GB disk)
  • Managed Enterprise: Custom, with dedicated hardware and SLAs

Code Example: Insert and Query with Qdrant

from qdrant_client import QdrantClient
from qdrant_client.models import (
    Distance, VectorParams, PointStruct, Filter, FieldCondition, MatchValue
)
import openai

client = QdrantClient(
    url="https://your-cluster.qdrant.io",
    api_key="YOUR_QDRANT_API_KEY"
)
openai_client = openai.OpenAI(api_key="YOUR_OPENAI_API_KEY")

COLLECTION = "documents"
DIMENSION = 1536

# Create collection
client.recreate_collection(
    collection_name=COLLECTION,
    vectors_config=VectorParams(size=DIMENSION, distance=Distance.COSINE),
)

# Insert documents
documents = [
    {"id": 1, "text": "Vector databases store embeddings for semantic search", "category": "infra"},
    {"id": 2, "text": "RAG pipelines retrieve context before LLM generation", "category": "llm"},
]

def embed(text: str) -> list[float]:
    response = openai_client.embeddings.create(
        model="text-embedding-3-small", input=text
    )
    return response.data[0].embedding

points = [
    PointStruct(
        id=doc["id"],
        vector=embed(doc["text"]),
        payload={"text": doc["text"], "category": doc["category"]}
    )
    for doc in documents
]

client.upsert(collection_name=COLLECTION, points=points)

# Query with optional metadata filtering
query_vector = embed("semantic search infrastructure")

results = client.search(
    collection_name=COLLECTION,
    query_vector=query_vector,
    query_filter=Filter(
        must=[FieldCondition(key="category", match=MatchValue(value="infra"))]
    ),
    limit=5,
    with_payload=True,
)

for hit in results:
    print(f"Score: {hit.score:.3f} | {hit.payload['text']}")

Pros and Cons

Pros: Best raw performance (highest QPS and recall in ANN benchmarks), excellent filtering, very clean API, open source with permissive Apache 2.0 license.

Cons: Fewer high-level abstractions than Weaviate, hybrid search is newer and less mature.


Chroma

Chroma is the default choice for local development and prototyping. It can run embedded in your Python process (zero infrastructure) or as a standalone server. Its simplicity is the point.

Pricing

Chroma is fully open source. There’s no managed cloud offering — you host it yourself. This means it’s free at any scale, but operational costs are on you.

Code Example: Insert and Query with Chroma

import chromadb
from chromadb.utils import embedding_functions

# Embedded mode — no server required, great for dev/scripts
client = chromadb.Client()

# Or for persistence across runs:
# client = chromadb.PersistentClient(path="./chroma_db")

openai_ef = embedding_functions.OpenAIEmbeddingFunction(
    api_key="YOUR_OPENAI_API_KEY",
    model_name="text-embedding-3-small"
)

collection = client.create_collection(
    name="documents",
    embedding_function=openai_ef
)

# Insert — Chroma handles embedding automatically
collection.add(
    documents=[
        "Vector databases store embeddings for semantic search",
        "RAG pipelines retrieve context before LLM generation",
    ],
    ids=["doc-1", "doc-2"],
    metadatas=[{"source": "guide"}, {"source": "guide"}]
)

# Query
results = collection.query(
    query_texts=["AI context retrieval"],
    n_results=3,
    include=["documents", "distances", "metadatas"]
)

for doc, dist in zip(results["documents"][0], results["distances"][0]):
    print(f"Distance: {dist:.3f} | {doc}")

Pros and Cons

Pros: Simplest setup of any option, embedded mode needs zero infrastructure, excellent for notebooks and local scripts, great for JSON Formatter or Base64 Encoder-style utility apps with local AI features.

Cons: Not designed for production scale, limited performance tuning options, no built-in replication or HA.


pgvector

pgvector is a PostgreSQL extension that adds vector storage and ANN search to your existing Postgres database. If your application already runs on Postgres, this is worth serious consideration.

Pricing

pgvector is an open source extension — free to use with your existing Postgres instance. Managed options include Supabase (free tier with pgvector), Neon (free tier), and Amazon RDS for PostgreSQL (standard RDS pricing).

Code Example: Insert and Query with pgvector

import psycopg2
from pgvector.psycopg2 import register_vector
import openai
import numpy as np

conn = psycopg2.connect("postgresql://user:password@localhost/mydb")
register_vector(conn)

openai_client = openai.OpenAI(api_key="YOUR_OPENAI_API_KEY")

cur = conn.cursor()

# Create table with vector column
cur.execute("""
    CREATE EXTENSION IF NOT EXISTS vector;
    CREATE TABLE IF NOT EXISTS documents (
        id SERIAL PRIMARY KEY,
        text TEXT,
        embedding vector(1536)
    );
    CREATE INDEX IF NOT EXISTS documents_embedding_idx
    ON documents USING ivfflat (embedding vector_cosine_ops)
    WITH (lists = 100);
""")
conn.commit()

def embed(text: str) -> list[float]:
    response = openai_client.embeddings.create(
        model="text-embedding-3-small", input=text
    )
    return response.data[0].embedding

# Insert
docs = [
    "Vector databases store embeddings for semantic search",
    "RAG pipelines retrieve context before LLM generation",
]
for doc in docs:
    cur.execute(
        "INSERT INTO documents (text, embedding) VALUES (%s, %s)",
        (doc, embed(doc))
    )
conn.commit()

# Query
query_vector = embed("AI context retrieval")
cur.execute("""
    SELECT text, 1 - (embedding <=> %s::vector) AS similarity
    FROM documents
    ORDER BY embedding <=> %s::vector
    LIMIT 5
""", (query_vector, query_vector))

for text, similarity in cur.fetchall():
    print(f"Similarity: {similarity:.3f} | {text}")

cur.close()
conn.close()

Pros and Cons

Pros: No new infrastructure if you already use Postgres, full SQL joins with vector search, familiar tooling and operations, ACID guarantees.

Cons: Performance doesn’t match purpose-built vector databases at large scale, ANN index options (IVFFlat, HNSW) require tuning, becomes a bottleneck above ~10M vectors.


Performance Benchmarks

Based on the ANN Benchmarks project and community testing (2025-2026):

DatabaseRecall@10QPS (single node)Indexing SpeedNotes
Qdrant0.97~8,000-15,000FastHNSW with on-disk indexing
Weaviate0.95~5,000-10,000MediumHNSW, more overhead from features
Pinecone0.95~3,000-8,000Fast (managed)Varies by pod type
pgvector (HNSW)0.93~2,000-5,000MediumHighly dependent on Postgres config
Chroma0.92~500-2,000Slow at scaleNot designed for high QPS

Benchmarks are approximations. Your numbers will vary based on dimension size, index parameters, hardware, and query patterns.


Managed vs Self-Hosted: The Decision Framework

Choose managed (Pinecone, Weaviate Cloud, Qdrant Cloud) when:

  • You want zero infrastructure management
  • Your team has no Kubernetes or Docker expertise
  • You’re early-stage and need to move fast
  • Compliance requirements allow third-party data storage
  • Budget is flexible (managed adds 2-4x cost vs self-hosting)

Choose self-hosted (Qdrant OSS, Weaviate OSS, Chroma, pgvector) when:

  • Data sovereignty or compliance requires keeping data on-premise
  • You have infra capacity (Kubernetes, Docker, or a VPS)
  • Cost at scale matters — self-hosted is 50-80% cheaper at high volume
  • You need custom configuration or integration with internal systems

A common pattern: use Chroma locally during development, migrate to Qdrant (Docker on a VPS) or Qdrant Cloud for production. The Python SDK is nearly identical between them, so migration is low friction.


Quick Decision Matrix

Your SituationRecommended Choice
Prototype / local devChroma
Already on Postgres, < 1M vectorspgvector
Production, no infra team, flexibility on costPinecone
Production, need hybrid search or multimodalWeaviate
Production, need best performance, open sourceQdrant
Enterprise, need SLA + dedicated infraPinecone Enterprise or Weaviate Dedicated

Practical Tips for Embedding at Scale

Chunk your documents carefully. Most embedding models have a 512-8192 token input limit. Chunks of 256-512 tokens with 10-15% overlap generally produce the best retrieval results. Tools like LangChain’s RecursiveCharacterTextSplitter or LlamaIndex handle this automatically.

Store the original text in metadata. Always save the raw text alongside the vector so you can return readable results without a second database lookup.

Normalize your embeddings. If using cosine similarity (the default for most text embedding models), normalize vectors to unit length before insertion. This makes dot product and cosine similarity equivalent and speeds up certain index implementations.

Use batch inserts. All five databases here support batch upsert. Inserting one vector at a time is dramatically slower — batch in groups of 100-500 for 10-50x throughput improvement.

Index after bulk load. For pgvector and Qdrant, if you’re doing a one-time bulk import, disable/defer index creation until after all vectors are inserted. This is significantly faster than building the index incrementally.


Summary

Vector databases are no longer optional for production AI apps — they’re infrastructure. The right choice depends on your existing stack, scale requirements, and operational capacity:

  • Pinecone if you want managed simplicity and can accept the cost and data-locality trade-offs
  • Weaviate if you need hybrid search or multimodal support
  • Qdrant if you want the best open-source performance with a clean API
  • Chroma for local development and prototyping
  • pgvector if you’re already on Postgres and don’t need to hit millions of vectors

Whichever you choose, the embedding model matters as much as the database. Test with your actual data — recall quality is far more important than raw QPS for most applications.

For related developer tools, check out DevPlaybook’s JSON Formatter for inspecting embedding metadata payloads and the Base64 Encoder for handling binary embedding serialization in HTTP APIs.

Free Download

50 CLI Commands That Save Hours Every Week

The exact Git shortcuts, file search tricks, Docker commands, and productivity hacks that senior developers use daily. Compiled from 5+ years of shipping production code.

  • Git mastery (10 cmds)
  • File & search wizardry
  • Docker & DevOps tricks
  • Process & network tools
  • Productivity boosters
  • macOS & Linux install guide

No spam. 1 email/week max. Unsubscribe anytime.

Found this guide useful? Check out our free developer tools.