|$ curl https://forge-ai.dev/api/markdown?path=docs/ai/vector-stores-comparison
$cat docs/vector-store-comparison.md
updated Recently·40 min read·published

Vector Store Comparison

AIIntermediate to Advanced🎯Free Tools
Introduction

Vector stores are specialized databases that index and query high-dimensional vectors (embeddings). They are the backbone of RAG applications, enabling semantic search over documents, images, and structured data.

Choosing the right vector store depends on scale, latency requirements, budget, deployment model (cloud vs self-hosted), and feature needs (hybrid search, filtering, multi-tenancy). This guide compares the most popular options with real code examples.

Feature Comparison
FeaturePineconeWeaviateQdrantChromapgvector
DeploymentManaged onlyManaged + Self-hostedManaged + Self-hostedSelf-hosted / EmbeddedSelf-hosted (Postgres)
Max Dimensions20,00065,53565,535Unlimited16,000
Distance Metricscosine, euclidean, dotproductcosine, l2, dot, hammingcosine, euclid, dot, manhattancosine, l2, ipcosine, l2, inner product
Hybrid SearchSparse-denseBM25 + VectorFull-text + VectorNo (manual)tsvector + Vector
FilteringMetadata filtersGraphQL filtersPayload filtersWhere clausesSQL WHERE + operators
Multi-tenancyNamespacesNative (class-level)Collection-basedCollection-basedSchema-based
Free Tier100K vectorsUnlimited (self-hosted)Unlimited (self-hosted)Unlimited (embedded)Unlimited (self-hosted)
Best ForManaged simplicityAI-native appsHigh performancePrototypingExisting Postgres
Pinecone

Pinecone is a fully managed vector database. Zero infrastructure to manage — just create an index and start querying. Best for teams that want vector search without operational overhead.

pinecone.py
Python
1import pinecone
2from langchain_pinecone import PineconeVectorStore
3from langchain_openai import OpenAIEmbeddings
4
5# Initialize Pinecone
6pc = pinecone.Pinecone(api_key="YOUR_API_KEY")
7
8# Create index (one-time setup)
9pc.create_index(
10 name="my-docs",
11 dimension=1536,
12 metric="cosine",
13 spec=pinecone.ServerlessSpec(cloud="aws", region="us-east-1"),
14)
15
16# Use with LangChain
17index = pc.Index("my-docs")
18vectorstore = PineconeVectorStore(
19 index=index,
20 embedding=OpenAIEmbeddings(),
21 namespace="production",
22)
23
24# Add documents
25vectorstore.add_documents(documents, ids=[doc.metadata["id"] for doc in documents])
26
27# Query with filters
28results = vectorstore.similarity_search(
29 "How to deploy Docker containers",
30 k=5,
31 filter={"category": "deployment", "year": {"$gte": 2025}},
32)
33
34# Hybrid search (sparse-dense)
35results = vectorstore.similarity_search(
36 "Docker compose networking",
37 k=5,
38 alpha=0.5, # 0=pure keyword, 1=pure semantic
39)

info

Pinecone's free tier includes 100K vectors, 1GB storage, and 1 namespace. Sufficient for prototyping and small production workloads. Paid plans start at $0.33/hour for serverless.
Weaviate

Weaviate is an AI-native vector database with built-in generative search, hybrid search, and multi-modal support. Its GraphQL API and schema-based approach make it ideal for complex applications.

weaviate.py
Python
1import weaviate
2from langchain_weaviate import WeaviateVectorStore
3from langchain_openai import OpenAIEmbeddings
4
5# Connect to Weaviate (local or cloud)
6client = weaviate.connect_to_local() # or connect_to_weaviate_cloud()
7
8# Create collection with schema
9collection = client.collections.create(
10 name="Documents",
11 vectorizer_config=weaviate.classes.config.Vectorizer.text2vec_openai,
12 generative_config=weaviate.classes.config.GenerativeConfig.openai(),
13)
14
15# Add data (auto-vectorized)
16with collection.batch.dynamic() as batch:
17 for doc in documents:
18 batch.add_object(
19 properties={
20 "title": doc.metadata["title"],
21 "content": doc.page_content,
22 "category": doc.metadata["category"],
23 },
24 )
25
26# Vector search
27results = collection.query.near_text(
28 query="How to use Docker",
29 limit=5,
30 return_metadata=weaviate.classes.query.MetadataQuery(distance=True),
31 filters=weaviate.classes.query.Filter.by_property("category").equal("devops"),
32)
33
34# Generative search (RAG built-in)
35results = collection.generate.near_text(
36 query="Explain Docker networking",
37 grouped_task="Summarize the key points from these documents",
38 limit=5,
39)
40print(results.generated)

best practice

Weaviate's built-in vectorizer (text2vec-openai, text2vec-cohere) eliminates the need to generate embeddings separately. It vectorizes on insert, keeping your pipeline simpler.
Qdrant

Qdrant is a high-performance vector database written in Rust. It excels at speed, offers advanced filtering, and supports quantization for memory efficiency. Ideal for performance-critical applications.

qdrant.py
Python
1from qdrant_client import QdrantClient
2from qdrant_client.models import (
3 VectorParams, Distance, PointStruct, Filter,
4 FieldCondition, MatchValue, Range,
5)
6from langchain_qdrant import QdrantVectorStore
7
8# Connect to Qdrant
9client = QdrantClient(url="http://localhost:6333")
10
11# Create collection
12client.create_collection(
13 collection_name="docs",
14 vectors_config=VectorParams(size=1536, distance=Distance.COSINE),
15 quantization_config=None, # Enable scalar quantization for 4x compression
16)
17
18vectorstore = QdrantVectorStore(
19 client=client,
20 collection_name="docs",
21 embedding=OpenAIEmbeddings(),
22)
23
24# Advanced filtering
25from qdrant_client.models import Filter, FieldCondition, MatchAny, Range
26
27results = vectorstore.similarity_search(
28 query="Kubernetes deployment strategies",
29 k=10,
30 filter=Filter(
31 must=[
32 FieldCondition(key="category", match=MatchValue(value="devops")),
33 FieldCondition(
34 key="complexity",
35 match=MatchAny(any=["intermediate", "advanced"]),
36 ),
37 ],
38 must_not=[
39 FieldCondition(key="deprecated", match=MatchValue(value=True)),
40 ],
41 ),
42)
43
44# Batch upsert for high throughput
45from qdrant_client.models import PointStruct
46points = [PointStruct(id=i, vector=emb, payload={"text": text}) for i, emb, text in zip(ids, embeddings, texts)]
47client.upsert(collection_name="docs", points=points)

info

Qdrant's Rust core delivers sub-millisecond queries at billion-vector scale. Enable scalar or product quantization to reduce memory usage by 4-8x with minimal accuracy loss.
Chroma

Chroma is a lightweight, developer-friendly vector database designed for local development and small-to-medium workloads. It runs embedded in your application or as a server.

chroma.py
Python
1from langchain_chroma import Chroma
2from langchain_openai import OpenAIEmbeddings
3from langchain_text_splitters import RecursiveCharacterTextSplitter
4
5# In-memory (development)
6vectorstore = Chroma.from_documents(
7 documents=docs,
8 embedding=OpenAIEmbeddings(),
9 collection_name="my_collection",
10)
11
12# Persistent storage
13vectorstore = Chroma.from_documents(
14 documents=docs,
15 embedding=OpenAIEmbeddings(),
16 collection_name="my_collection",
17 persist_directory="./chroma_data",
18)
19
20# Query
21results = vectorstore.similarity_search_with_score(
22 "How does caching work?",
23 k=5,
24)
25
26# Metadata filtering
27results = vectorstore.similarity_search(
28 "cache invalidation strategies",
29 k=5,
30 filter={"category": "performance", "difficulty": "advanced"},
31)
32
33# ChromaDB server mode
34import chromadb
35client = chromadb.HttpClient(host="localhost", port=8000)
36collection = client.get_or_create_collection("docs")

warning

Chroma is not designed for high-concurrency production workloads. Use it for development, prototyping, and small applications (<1M vectors). For production at scale, migrate to Pinecone, Qdrant, or Weaviate.
pgvector

pgvector is a Postgres extension that adds vector search to your existing database. If you already use Postgres, it eliminates the need for a separate vector database.

pgvector.sql
SQL
1-- Enable pgvector extension
2CREATE EXTENSION IF NOT EXISTS vector;
3
4-- Create table with vector column
5CREATE TABLE documents (
6 id SERIAL PRIMARY KEY,
7 content TEXT NOT NULL,
8 embedding VECTOR(1536) NOT NULL,
9 metadata JSONB DEFAULT '{}',
10 created_at TIMESTAMPTZ DEFAULT NOW()
11);
12
13-- Create HNSW index for fast approximate search
14CREATE INDEX ON documents
15 USING hnsw (embedding vector_cosine_ops)
16 WITH (m = 16, ef_construction = 64);
17
18-- Similarity search
19SELECT content, metadata,
20 1 - (embedding <=> $1) AS similarity
21FROM documents
22WHERE 1 - (embedding <=> $1) > 0.7
23ORDER BY embedding <=> $1
24LIMIT 5;
25
26-- Hybrid search: vector + full-text
27SELECT d.content,
28 1 - (d.embedding <=> $1) AS vector_score,
29 ts_rank_cd(d.search_vector, plainto_tsquery('english', $2)) AS text_score
30FROM documents d
31WHERE d.search_vector @@ plainto_tsquery('english', $2)
32 OR 1 - (d.embedding <=> $1) > 0.5
33ORDER BY (vector_score + text_score) DESC
34LIMIT 10;
pgvector_python.py
Python
1# LangChain integration with pgvector
2from langchain_postgres import PGVector
3from langchain_openai import OpenAIEmbeddings
4
5vectorstore = PGVector(
6 connection="postgresql+psycopg://user:pass@localhost:5432/db",
7 embeddings=OpenAIEmbeddings(),
8 collection_name="documents",
9 use_jsonb=True, # Store metadata as JSONB
10)
11
12# Add documents
13vectorstore.add_documents(documents)
14
15# Query with hybrid search
16results = vectorstore.similarity_search(
17 "Docker networking",
18 k=5,
19)

info

pgvector v0.7+ supports HNSW indexing, matching dedicated vector DB performance for collections under 10M vectors. If you already run Postgres, try pgvector before adding a new database.
Decision Guide

Choose your vector store based on these criteria. Start simple and migrate when you outgrow the current solution.

Prototype / Hackathon

Chroma — Zero setup, in-memory, embedded. Get from idea to demo in minutes.

Existing Postgres + Small Scale

pgvector — No new infrastructure. Add vector search to your existing database.

Production — Zero Operations

Pinecone — Fully managed, scales automatically, no DevOps needed.

Production — Self-hosted, High Performance

Qdrant — Fastest queries, best quantization, full control over infrastructure.

Production — AI-Native Features

Weaviate — Built-in vectorizers, generative search, multi-modal support, GraphQL API.

best practice

All vector stores support the same core operations: upsert, search, delete. Switching between them later is straightforward with LangChain or LlamaIndex abstractions. Don't over-optimize early — pick the simplest option that works.
$Blueprint — Engineering Documentation·Section ID: AI-VS-01·Revision: 1.0