Retrieval Augmented Generation

Layer 2 · Mechanics

Retrieval Augmented Generation

The pipeline in detail: chunking, embeddings, vector search, hybrid retrieval, reranking, and prompt assembly.

9 min read70 XP

A production RAG system splits cleanly into two pipelines that run at completely different times. The indexing pipeline runs offline, whenever documents change. The query pipeline runs online, on every user question, under a latency budget. Confusing the two is the most common architectural mistake.

  1. Documents

    PDFs, wiki, tickets

  2. Parse

    to clean text

  3. Chunk

    split into passages

  4. Embed

    text → vector

  5. Index

    store in a vector DB

Indexing: offline, batch, run once per document version.
Go deeper: L3 Code