All resourcesGuide
RAG Architecture Guide
The complete reference architecture for production RAG systems.
Content
Ingestion: multi-format → clean → chunk (section-aware, 512 tokens, 64 overlap) → embed (1024-dim) → store in pgvector with metadata. Query: rewrite → hybrid search (vector + BM25 with RRF) → rerank (cross-encoder) → top-5 → LLM with cited context → output guard → citation. Production: cache (semantic, 0.95 threshold) + route (small model default) + trace + online eval + cost budget + RBAC filter at query.