Vector databases are purpose-built for storing and querying embeddings at scale. This guide compares the leading options — Pinecone, Weaviate, Qdrant, pgvector, and Chroma — and helps you choose the right one for your use case.
For fewer than 100K documents and simple similarity search, you do not need a dedicated vector database. FAISS in memory or `pgvector` (PostgreSQL extension) is simpler, cheaper, and fast enough. A dedicated vector database pays off when you need: hundreds of millions of vectors, real-time updates at scale, hybrid metadata filtering, or managed cloud infrastructure.
Start with the simplest option that works. Most teams that reach for Pinecone or Weaviate first would have been better served by pgvector with fewer moving parts.
pgvector adds vector similarity search to PostgreSQL. If you already use Postgres, this is the lowest-friction option — no new infrastructure, familiar SQL interface, ACID transactions, and existing backup/monitoring tooling.
Add it to any Postgres instance: `CREATE EXTENSION vector; ALTER TABLE documents ADD COLUMN embedding vector(1536); CREATE INDEX ON documents USING ivfflat (embedding vector_cosine_ops);`. Query: `SELECT content FROM documents ORDER BY embedding <=> query_embedding LIMIT 10`. Scales to tens of millions of vectors on a well-tuned Postgres instance.
Qdrant is an open-source vector database written in Rust that supports complex metadata filtering alongside vector search. Its key advantage over pgvector is filtering efficiency: you can filter on dozens of metadata fields without sacrificing search speed, which is critical for multi-tenant applications.
Run locally with Docker: `docker run -p 6333:6333 qdrant/qdrant`. Python client: `pip install qdrant-client`. Create a collection: `client.create_collection('documents', vectors_config=VectorParams(size=1536, distance=Distance.COSINE))`. Qdrant also has a managed cloud offering.
Pinecone is a fully managed vector database that handles scaling, replication, and infrastructure automatically. It is the easiest to get started with for production use: no servers to manage, a generous free tier, and a simple SDK.
The trade-off is cost and vendor lock-in. At large scale, Pinecone is significantly more expensive than self-hosted Qdrant or pgvector. Use it when your team's time is better spent on product than infrastructure, and when the volume is high enough to justify managed services.
Chroma is the simplest vector store for local development and prototyping. It runs in-memory with optional persistence, has a minimal API, and integrates directly with LangChain and LlamaIndex. `pip install chromadb`. Create and query: `client = chromadb.Client(); collection = client.create_collection('docs'); collection.add(documents=['...'], embeddings=[[...]], ids=['1']); results = collection.query(query_embeddings=[[...]], n_results=5)`.
Use Chroma for development and switch to Qdrant or pgvector for production. The APIs are similar enough that migration is straightforward through LangChain's vector store abstraction.
Text embeddings convert text into dense vector representations that capture semantic meaning. This guide covers generating embeddings with OpenAI and local models, measuring similarity, and practical applications.
Semantic search finds relevant results based on meaning rather than keywords. This guide builds a complete semantic search system from document ingestion to ranked retrieval, using embeddings and a vector store.
Read guideEmbedding model choice significantly affects search quality and cost. This guide compares the leading models — OpenAI text-embedding-3, Cohere embed, BAAI/bge, and others — across quality, speed, cost, and language support.
Read guide