15.5 RAG (Retrieval Augmented Generation)
Retrieval Augmented Generation (RAG) combines a language model with a search step. When a user asks a question, the system first retrieves relevant documents from a knowledge base, then gives those documents to the LLM as context so its answer is grounded in real, current information rather than only the model's memorised training data.
Suppose Ethio Telecom releases a new tariff this week. A plain LLM trained last year would not know it, but a RAG system can pull the latest tariff PDF from the company's database and answer correctly. Retrieval usually works by comparing embedding vectors to find the most semantically similar passages.
Scenario
You need a chatbot that answers from frequently-changing company policy documents and avoids making things up. What design fits best?
Check your understanding
1/4 · 40 XPWhat problem does RAG primarily solve?