The RAG architecture blueprint
The reference design: ingestion, index, query pipeline, generation and the feedback loop around them.
A RAG system is two pipelines that meet at an index. The offline pipeline ingests source documents, cleans and splits them, embeds the pieces and stores them with metadata. The online pipeline takes a question, optionally rewrites it, retrieves candidates, reranks, assembles a prompt, generates an answer and returns it with sources.
Around those sit the parts teams forget: evaluation to know if it works, logging of every retrieval so failures can be diagnosed, and a feedback path so bad answers become test cases. Treat the index as a derived artifact. You must be able to rebuild it from the source of truth at any time.
Keep each stage swappable behind a clear interface: parser, chunker, embedder, store, retriever, reranker, generator. Almost every improvement you will make later is a change to one stage, and you can only judge it if the others hold still.
Key points
- Offline: ingest, clean, chunk, embed, index. Online: rewrite, retrieve, rerank, assemble, generate.
- The index is derived. Always be able to rebuild it from source.
- Log every retrieval and answer for debugging and evaluation.
- Keep stages modular so you can change one and measure the effect.
Answer these out loud
- 1Draw the two pipelines for a support-docs assistant and mark where each failure mode (missing doc, wrong chunk, hallucinated answer) would originate.
- 2Which component would you version first, and what would you store with each index build?
Use this from an agent
Any MCP client, including Grok, can read this lesson. See how to connect.
curl https://engineeros-delta.vercel.app/api/v1/topics/rag-architecture-blueprint