tool

pgvector

pgvector is the Postgres extension that adds vector data types, similarity search, and indexes (IVFFlat, HNSW) — turning Postgres into a usable vector database for RAG workloads in 2026.

pgvector ships vector columns (`vector(1536)`), distance operators (`<->` L2, `<#>` inner product, `<=>` cosine), and ANN indexes (IVFFlat, HNSW). Combined with Postgres, it gives you SQL + vectors in one database — no separate Pinecone / Weaviate / Qdrant instance to operate. Trade-offs: pgvector scales to tens of millions of vectors comfortably; dedicated vector DBs scale further and ship features like hybrid search + reranking out of the box. The 2026 sweet spot: pgvector for RAG-in-the-app teams already on Postgres (Supabase, Neon, AWS RDS), dedicated vector DBs for >100M-vector workloads or where vector is the primary access pattern. Most Supabase RAG apps use pgvector.

When to use pgvector

Common mistakes

FAQ

What is pgvector?

pgvector is the Postgres extension that adds vector data types, similarity search, and indexes (IVFFlat, HNSW) — turning Postgres into a usable vector database for RAG workloads in 2026.

When should I use pgvector?

RAG apps already running Postgres. <100M vectors with mixed SQL + similarity queries.

What are the most common mistakes with pgvector?

Skipping the ANN index — sequential scans of vectors collapse under load. Picking IVFFlat when HNSW is the better default — HNSW is faster and more accurate for most workloads.

Sources

Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/pgvector.md.