Skip to content
Back to course

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.

CollectCleanAnalyseInsight
RAG pipeline: retrieve relevant documents, then generate a grounded answer.

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 XP

What problem does RAG primarily solve?