Retrieval-augmented generation (RAG)
Retrieval-augmented generation, or RAG, retrieves external evidence for a request and supplies that evidence to a generative model.
Tiny example
Section titled “Tiny example”question: What is our enterprise cancellation window?retrieve: the current enterprise cancellation policygenerate: answer from that passagecite: link to the policy sectionRAG is useful when answers depend on private, current, attributable, or frequently changing information.
Two lifecycles
Section titled “Two lifecycles”- Indexing: load, parse, split, embed, and store the source material.
- Answering: retrieve, assemble context, generate, and cite.
The distinction matters during debugging. A generation prompt cannot repair missing or stale indexed content.
Continue with the full RAG, end to end chapter.