Skip to content

RAG

Retrieval-Augmented Generation (RAG) augments model inputs with externally retrieved knowledge.

Work Process

  1. Prepare external knowledge, usually by chunking documents and building an index.
  2. Retrieve context relevant to the user query.
  3. Augment the prompt with the retrieved context.
  4. Update the knowledge base as the external corpus changes.