← All writing

A Practical Guide to Vector Databases for RAG

· Muaaz Ahmad

Retrieval-Augmented Generation (RAG) is only as good as its retrieval layer. Picking the right vector database is the most important decision you'll make.

What to look for

  1. Recall vs latency — HNSW indexes trade memory for speed
  2. Hybrid search — combine dense vectors with BM25 for better results
  3. Filtering — metadata filters can make or break production use

Popular choices

  • pgvector — great if you already run Postgres
  • Qdrant — purpose-built, excellent filtering
  • Pinecone — fully managed, scales well

Start simple. pgvector handles millions of vectors comfortably and gives you SQL joins for free.

Newsletter

Get the next post by email

Production AI engineering, three times a week. Free, on Substack.

Need this built for real?

I take systems like this into production. Email me or download the CV.