Skip to main content
Vector DBEmbeddingsRAG

Vector Databases: A Practical Guide for AI Engineers

When to use them, which one to pick, and the mistakes everyone makes with embeddings.

Dhiwin Samrich
Dhiwin SamrichAI/ML Engineer
Mar 2025·7 min read

What Is a Vector Database?

A vector database stores high-dimensional numerical representations of data (embeddings) and enables fast approximate nearest-neighbor (ANN) search. It answers the question: "what is most semantically similar to this query?"

When You Actually Need One

You don't always need a dedicated vector database. pgvector on Postgres handles millions of vectors fine. You need a dedicated vector DB when you hit billions of vectors, need sub-10ms query latency, or require advanced filtering at scale.

pgvector Is Enough for Most Projects

If you're already on Postgres, add pgvector. You get ACID transactions, familiar SQL, and good-enough ANN performance for most startups. Don't add infrastructure complexity until you have the scale to justify it.

Comparing the Major Options

Pinecone is the easiest managed option. Weaviate has the richest feature set. Qdrant has the best performance-per-dollar on self-hosted deployments. Chroma is great for local development and prototyping.

Qdrant for Production Self-Hosting

If you're self-hosting, Qdrant is the standout choice. Written in Rust, memory-mapped storage, excellent filtered search, and a clean HTTP + gRPC API. The payload filtering (filter by metadata while searching) is fast and expressive.

Pinecone for Managed Simplicity

No infrastructure to manage, serverless pricing, and built-in sparse-dense hybrid search. The tradeoff is vendor lock-in and cost at high query volumes.

Embedding Model Selection

The embedding model matters as much as the database. text-embedding-3-large from OpenAI, voyage-large-2 from Voyage AI, and nomic-embed-text are the current top performers on the MTEB benchmark.

Match Embedding Model to Your Domain

General embeddings work for general text. For code, use a code-specific embedding model. For legal documents, fine-tuning a domain-specific embedding model on your corpus will significantly outperform general models.

Common Mistakes

The biggest mistake: chunking documents too large or too small. 512 tokens is a good starting point. The second biggest: not re-embedding when you upgrade your embedding model — old and new vectors are not comparable.

The Future of Vector Search

Hybrid search (combining dense vectors with sparse BM25 keyword search) consistently outperforms pure vector search on real-world retrieval tasks. Every major vector DB now supports it. Use it.

Share
Let's Talk-Knight's Gambit-Game On-
Consultant