ELI5: How does RAG work
RAG is like asking a friend (the Large Language Model) a question, but first, that friend quickly looks up relevant information in a big notebook (the Knowledge Base) before answering.
Imagine you want to know "What's the best place to get pizza?" Your friend, let's call him Lenny (the LLM), doesn't just give you a random answer. Instead, he uses RAG like this:
- Retrieval: Lenny first checks his "pizza notebook" (Knowledge Base). This notebook has information about all the pizza places in town, like their menus, prices, and reviews. He quickly finds the pages about pizza places near you.
- Augmentation: Lenny takes the information from his notebook (like "Luigi's has 5-star reviews and a deal on pepperoni pizza tonight") and combines it with your question. Now he has all the ingredients to give you a great answer.
- Generation: Finally, Lenny uses all this information to answer your question in a helpful way. He might say, "Based on my pizza notebook, Luigi's is the best place to get pizza tonight because they have 5-star reviews and a special on pepperoni!"
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!