LLM EngineeringApril 30, 20267 min read

    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.

    FAQ

    Is pgvector enough for RAG?
    Often, yes. pgvector can be a strong choice when your scale is moderate, your team already runs Postgres, and you want simpler operations. Dedicated vector databases become more attractive when retrieval scale, filtering, latency, or operational features demand them.

    More reading