RAG with Postgres pgvector in 2026: the full TypeScript pipeline.
pgvector 0.8.0's iterative HNSW scans make filtered similarity search practical, enabling a full RAG pipeline in TypeScript using a single Postgres instance instead of dedicated vector databases. The pipeline chunks documents, embeds them with OpenAI's text-embedding-3-small (1,536 dims), stores in pgvector with an HNSW index, retrieves by cosine distance, and augments an LLM call (Claude or GPT-4o). At 10M documents, top-10 results return in under 10ms, collapsing three infrastructure components into one connection string and backup strategy.