An open-book exam for AI
Day 3 of 149
π Full deep-dive with code examples
The Open-Book Exam
Imagine two types of exams:
Closed-book exam:
- You mostly rely on what's in your head
- If you didn't memorize it, you're stuck
Open-book exam:
- You can look things up
- Reference your notes
- Find the specific answer
RAG gives AI an open-book exam!
The Problem
LLMs (like ChatGPT) have knowledge frozen at training time:
- Don't know recent events
- Can't access your private documents
- Sometimes make things up (hallucinate)
How RAG Works
Retrieval-Augmented Generation:
- Question comes in β "What's our refund policy?"
- Retrieval β Search your documents for relevant info
- Augment β Add that info to the prompt
- Generate β AI answers using the found documents
User: "What's the refund policy?"
β
[Search company docs]
β
Found: "Refunds within 30 days with receipt..."
β
AI: "Based on your policy, refunds are allowed within 30 days..."
Why It's Powerful
- β AI can answer about YOUR data
- β Answers are grounded in real documents
- β Reduces hallucinations
- β Can stay up-to-date (as your docs change, answers can change)
In One Sentence
RAG lets AI look up information before answering, like having notes during a test.
π Enjoying these? Follow for daily ELI5 explanations!
Making complex tech concepts simple, one day at a time.
Top comments (0)