All Technologies
Databases·expert

pgvector

Vector search, in the database you already run

pgvector turns Postgres into a competent vector store for retrieval-augmented generation, semantic search, and recommendations. I use it heavily for sub-10M-vector workloads where keeping embeddings, metadata, and transactional data in one queryable system beats the operational cost of a separate vector database.

3+

Years

28+

Projects

expert

Proficiency

My take

Why I use pgvector

For most RAG workloads under 10 million vectors, pgvector wins on operational simplicity. Embeddings live next to the rows they describe, so I can JOIN against permissions, tenancy, and metadata in one query. HNSW indexes ship in pgvector 0.5+ and bring recall and latency into the same league as dedicated vector stores for typical workloads.

Want the broader stack philosophy? Read about how Sri picks tools or browse engineering insights.

Honest assessment

Strengths & tradeoffs

No tool is perfect. Here's what shines and what to watch for.

Strengths

  • Vectors live in Postgres, transactional with the rest of your data
  • HNSW and IVFFlat indexes cover most accuracy/latency tradeoffs
  • Hybrid search (BM25 + vector) is one SQL query away
  • Works on every managed Postgres (Supabase, Neon, RDS, Aurora)
  • No new system to monitor, back up, or secure

Tradeoffs (honestly)

  • Index build time grows with dataset size
  • Memory footprint of HNSW indexes is significant
  • Beyond ~10M vectors, dedicated stores (Pinecone, Qdrant) start winning
  • Filtered search performance depends heavily on index strategy

Fit assessment

When to reach for pgvector

Pick the right tool for the job.

Best fits

RAG pipelines under 10M vectors

Multi-tenant search where row-level filtering matters

Hybrid keyword + semantic retrieval in one query

Recommendations co-located with product data

Teams that already operate Postgres at scale

Not ideal for

Workloads with 100M+ vectors and tight latency SLOs

Pure-vector workloads with no relational data

Teams without Postgres operational expertise

Common use cases

RAG over private documentsSemantic searchRecommendationsHybrid keyword + vector retrieval

Need help with pgvector?

Whether you're starting fresh or optimizing an existing implementation, I can help you get the most out of this technology. Read more in insights or get in touch.