AI Foundations

What Is Retrieval-Augmented Generation (RAG)?

Retrieval-augmented generation combines information retrieval with a language model so responses can use selected external documents as context.

A system embeds or indexes source material, retrieves relevant passages for a query and places them in the model context. The model then drafts an answer from the supplied evidence.

Two practical examples

Example 1. An internal assistant retrieves company policy pages before answering an employee question.

Example 2. A product-support tool retrieves the relevant manual section before explaining a setup step.

What to check in practice

  • Identify the exact device, software version or service involved before changing a setting.
  • Record the current configuration so you can reverse a change that causes problems.
  • Test one variable at a time and confirm the result using reliable measurements or logs.
  • Use the official documentation for model-specific limits, compatibility and safety requirements.
Important consideration

RAG does not guarantee correctness. Poor retrieval, stale documents or weak citations can still produce misleading answers.

Common question

What is the first thing to do? Start by identifying the exact use case and the system involved. Then verify the relevant settings or measurements before making changes. A general explanation is a starting point, not a substitute for checking your own environment.

TryHook publishes independent educational explainers. Product names and technical standards belong to their respective owners. Some pages may eventually contain clearly disclosed affiliate links; editorial explanations are not paid endorsements.

Explore more in AI Foundations

Continue with related beginner-friendly guides.

AI vs Machine Learning vs Deep LearningRead guideWhat Is a Large Language Model?Read guide