AI Hints
Home›RAG Tutorial›What Is RAG
RAG · Lesson 1 of 120

What Is RAG

Answers from your documents.

⏱ 2 min read▶ Video at 0:00🎓 Free
Watch this lesson in the RAG courseWatch on YouTube ↗Full RAG course

RAG stands for retrieval augmented generation. It's a simple idea. Before a language model answers a question, we find the most useful pieces of our own documents, and hand them to the model with the question. The model then answers from those facts.

What Is RAG
From the video: What Is RAG
  • Retrieval
  • Augmented
  • Generation

RAG in one picture

A customer asks a question. We search our documents for the parts that match. We pick the best few pieces. We give those pieces and the question to the model. And the model writes an answer, based on our own facts.

  1. Question
  2. Search docs
  3. Best pieces
  4. Model reads them
  5. Answer
RAG in one picture
From the video: RAG in one picture

Why people use RAG

RAG lets a model answer questions about things it was never trained on, like your company's policies. Answers can point to their sources, so people can check them. When a document changes, the answers change too, with no retraining. And it's cheap to build.

keyvalue
Your own factsprivate documents
Sourcesanswers you can check
Always freshedit a file, done
Cheapno training needed

Summary

RAG means finding the right pieces of your documents, and letting the model answer from them. Next, why models need this help.

Key takeaways
  • Retrieve the facts
  • Add them to the prompt
  • Generate the answer
Next up: Why Models Need RAG — private and fresh facts