techdiagrams.net
← All templates

Production RAG platform

Retrieval-augmented generation beyond the demo: hybrid dense+sparse retrieval, a re-rank stage, ACL-aware filtering, a semantic cache and freshness re-indexing.

Open in editor — free, no login Download JSON
INGESTION & RETRIEVAL — WHERE RAG QUALITY ACTUALLY LIVESingestembeddings upserttermschanged docs onlyquestionsemantic lookup firstdense top-50 · ACL filtersparse top-50candidatesfuse (RRF)top-8 + promptDocs · wikis · ticketsthe knowledgeChunk & embedsplit → embed → upsertVector indexdense · HNSWKeyword indexsparse · BM25Freshness loopre-embeds changed docs onlyUserasks in proseRAG APIauth → retrieve → generateSemantic cachesimilar-question hitsRe-rankercross-encoder · top-50 → top-8LLManswers WITH citationsthe model is the LAST box for a reason:bad retrieval + great model = confident nonsense.Great retrieval + decent model = cited answers.

What this design does

Demo RAG is a vector search and a prayer. Production RAG is a pipeline: documents are chunked and embedded continuously (with a freshness loop re-indexing only what changed), queries hit BOTH a dense vector index and a sparse keyword index, a cross-encoder re-ranks the fused candidates, and retrieval is filtered by the asker's permissions — the model can't leak a document the user couldn't open. A semantic cache short-circuits the questions everyone asks. The LLM is the last, smallest box.

The patterns it composes

Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.