How to choose a vector database for RAG
A practical guide to choosing a vector database for RAG: pgvector, Pinecone, Weaviate, Qdrant, filtering, hybrid search, scale, and operations.
The best vector database is the one that fits your retrieval problem, not the one with the loudest launch announcement. RAG quality depends on documents, chunking, embeddings, filters, reranking, and evaluation as much as the database itself.
Start with constraints
- How many chunks will you index now and in a year?
- How often do documents update?
- Do queries need strict metadata filters or permissions?
- What latency is acceptable for the user workflow?
Consider operational fit
pgvector keeps operations simple if Postgres is already core to your stack. Managed vector databases can reduce infrastructure work and add features for scale, but they introduce another system to secure, monitor, and pay for.
Do not skip hybrid search
Many corpora need both semantic and lexical matching. Product names, IDs, error codes, and policy terms often benefit from keyword search combined with vector retrieval and reranking.
Choose the database after testing retrieval quality on real questions. A quick benchmark with your own documents is worth more than a generic feature checklist.