AI Basics Learning Path
Lesson 20 of 30

████████████████████░░░░░░

Lesson 20 — What Is RAG (Retrieval-Augmented Generation)?

AI models learn from training data, but they may not always have access to the information you want them to use.

What if an AI system could search for relevant information before generating its answer?

This is the basic idea behind RAG.

What Does RAG Mean?

RAG stands for Retrieval-Augmented Generation.

It is a technique that combines information retrieval with AI-generated responses.

Instead of relying only on what the model learned during training, the system can retrieve relevant external information and provide it to the model.

How Does RAG Work?

A simplified RAG process looks like this:

User question → Retrieve information → AI model → Answer

First, the system receives the user’s question.

It then searches a connected source for relevant information.

The retrieved information is provided to the AI model, which uses it to generate the answer.

Where Does the Information Come From?

A RAG system can retrieve information from many different sources.

  • Company documents
  • Web pages
  • Knowledge bases
  • PDF files
  • Databases
  • Internal documentation

Why Is RAG Useful?

RAG can be useful when an AI needs information that may not be included in its original training data.

For example, a company could connect an AI assistant to its internal documentation.

Employees could then ask questions about company policies and receive answers based on those documents.

RAG and Up-to-Date Information

RAG can also help systems work with newer information.

Instead of requiring the entire AI model to be retrained whenever information changes, the system can retrieve updated information from an external source.

RAG Does Not Automatically Make AI Correct

Retrieving information does not guarantee that the final answer is correct.

If the system retrieves poor, outdated, or irrelevant information, the generated answer can still be wrong.

The quality of the retrieved information therefore matters.

RAG vs AI Training

RAG and model training are different processes.

  • Training teaches the model patterns using training data.
  • RAG provides external information to the model during a task.

A Simple Analogy

Imagine taking an exam.

Training is like everything you studied before the exam.

RAG is like being allowed to consult a relevant reference book before answering a question.

Key Takeaways

  • RAG stands for Retrieval-Augmented Generation.
  • RAG allows AI systems to retrieve external information before generating an answer.
  • Information can come from documents, databases, websites, and knowledge bases.
  • RAG can help AI work with more recent or specialized information.
  • The quality of the retrieved information affects the quality of the answer.

What’s Next?

We have now covered some of the key technologies behind modern AI systems.

Next, we will look at another important concept: how AI models are fine-tuned to become more useful and better aligned with human instructions.

Scroll to Top