Apr 28, 2026 AI · 1 min read

Cheap RAG: how far you can go on a single Postgres

pgvector, halfvec, BM25 with paradedb — when you don't need a vector DB and how to know.

Most teams reach for a vector database before they need one. Postgres + pgvector handles 10M vectors comfortably on a $40/mo box. Add halfvec for memory savings, paradedb for BM25, and you have hybrid retrieval without the operational tax.

When you do need a vector DB

You need 100M+ vectors, you need sub-50ms p99 across regions, or you have multi-tenant isolation requirements that make a single Postgres painful. Otherwise: just use Postgres.

The setup

CREATE EXTENSION vector;
CREATE EXTENSION pg_search;
CREATE TABLE chunks (
  id bigserial PRIMARY KEY,
  embedding halfvec(1024),
  content text,
  doc_id bigint
);
CREATE INDEX ON chunks USING hnsw (embedding halfvec_cosine_ops);

That’s the whole stack.