How does RAG work?

  1. Prepare: split documents into passages and index them (often as embeddings in a vector database).
  2. Retrieve: find the passages most relevant to the question.
  3. Generate: the model answers using those passages, ideally citing them.

Why do businesses use RAG?

  • Answers based on your policies, products and documents.
  • Easy to update — change the document, not the model.
  • Fewer invented answers, because the model is grounded in sources.
  • Access control — retrieve only what a user is allowed to see.

RAG vs fine-tuning

RAGFine-tuning
Best forFacts that change, large document setsStyle, format, narrow skills
UpdatingEdit the documentsRetrain the model
TraceabilityCan cite sourcesHard to trace