ELI5: What is Retrieval-Augmented Generation (RAG) and how it works?
Imagine you're doing your homework on "Dinosaurs".
- No RAG: You only have your textbook. You read the textbook and answer the questions based only on what's in the textbook. If the textbook doesn't mention a specific dinosaur, you can't answer questions about it!
- RAG (Retrieval-Augmented Generation): Now, imagine you have your textbook and access to a bunch of other dinosaur books and websites!
- The Question: Your teacher asks, "What did Tyrannosaurus Rex eat, and how big were its teeth?".
- Retrieval (Finding the Right Info): Instead of only looking in your textbook, you use a super-fast search engine (like Google) to find relevant information in all your dinosaur books and websites. This is like the
retrievalpart of RAG. The search engine finds the most relevant parts of all the available information.
- Augmentation (Adding to What You Know): The search engine shows you snippets from different sources that talk about T-Rex's diet and teeth. This is called
augmentation. You're adding to the knowledge you already have from your textbook.
- Generation (Answering the Question): Now, you use both your textbook knowledge and the information you found in the search results to answer the question. You can now give a much better and more complete answer, because you're using all the information available, not just what's in one place. You're
generatinga new answer based on both your existing knowledge and the retrieved information.
How was this explanation?
Follow-Up Questions
Still curious? Ask a follow-up!
Test Your Understanding
Take a quick quiz and challenge your friends!
📧 Get this explanation by email
Receive this explanation in your inbox, plus get weekly simple explanations of trending topics!