Building a Production RAG App: The Decisions, the Traps, and the Fixes

I built a full-stack RAG application — streaming chat, document ingestion, hybrid search, sub-agents, admin-managed model config — and most of the hard parts had nothing to do with calling an LLM. The LLM call is 20 lines. The other 95% is retrieval quality, ingestion correctness, and not blocking your event loop.
This walks through the real decisions and the traps I hit: where naive RAG breaks, and the exact fix that shipped. Every number here is from the running code, not a whitepaper.
All the code is open source: github.com/pkhamdee/rag. Every snippet below links to the file it came from, so you can read the full implementation in context.
Credit: the template's structure and workflow originate from the Claude Code Agentic RAG Masterclass



