How to choose and use a vector database

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.

Do you need a dedicated vector database?

For fewer than 100K documents and simple similarity search, you do not need a dedicated vector databaseVector DatabaseA database optimized for storing and searching embedding vectors, enabling fast semantic similarity search across millions of text chunks or documents.Learn more →. 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: the pragmatic choice

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 embeddingEmbeddingA numerical vector representation of text, code, or images that captures semantic meaning — similar items have similar vectors, enabling search, clustering, and retrieval.Learn more → 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: open-source with strong filtering

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: managed scale

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: fastest local development

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.