Indexing happens once, offline; retrieval and generation happen live, on every question
RAG is really two pipelines wired together: one that prepares knowledge ahead of time (indexing), and one that uses it at answer time (retrieval plus generation). Knowing both — and exactly where they connect — is what makes it possible to debug a RAG system that's returning bad answers, instead of just reciting the acronym. Nearly every production RAG bug traces back to one specific stage; being able to name the stage is the difference between a 10-minute fix and a multi-day investigation.
Indexing happens once, or on a periodic schedule, per document. Retrieval and generation happen on every single user query. A slow or broken indexing step corrupts everything retrieved from it later, silently, until someone notices the answers are wrong — it's the more dangerous failure mode precisely because it's invisible at write time. A slow or broken retrieval step only affects the current query and is much easier to notice and roll back.
Trace a single sentence from a fictional employee handbook through the whole pipeline, with concrete (illustrative) numbers at every stage:
Notice the query never shared exact words with the source text ("PTO" vs. "paid leave," "new hires" vs. "prorated for new hires") — this only worked because of the embedding step, which is why Embeddings is the component that makes semantic (meaning-based) retrieval possible at all, as opposed to plain keyword search.
The pipeline above is "naive RAG" — one embed, one search, one generate. Every technique in the rest of this guide inserts itself at one specific point in that same flow:
page_content — the document is "indexed" but invisibly contributes nothing.