openskills.info
Course Preview

Retrieval-Augmented Generation

Retrieval-augmented generation (RAG) combines a large language model with an external knowledge retrieval step: relevant documents are fetched from a corpus and injected into the prompt so the model can answer with up-to-date, grounded information rather than relying solely on its training data.

itArtificial intelligence and machine learning

Retrieval-Augmented Generation

Retrieval-augmented generation (RAG) is an architecture pattern that connects a language model to external knowledge at inference time. Instead of relying solely on what the model learned during training, you retrieve relevant documents from your own data and include them in the prompt. The model generates its answer grounded in that retrieved context.

The pattern exists because language models have a fixed knowledge cutoff, hallucinate when they lack information, and know nothing about your proprietary data. RAG addresses all three by giving the model access to current, authoritative, domain-specific content exactly when it needs it.

The core idea

A RAG system has two stages that run on every request:

  1. Retrieve. Given the user's question, search a knowledge base for the most relevant documents or passages.
  2. Generate. Pass the retrieved content into the prompt alongside the question. The model generates an answer grounded in that context.

Continue the course

This section is part of the paid course.

See pricing to subscribe, or log in if you already have access.

Where this skill leads

Relevant careers

See how this topic contributes to broader role-level skill maps.

Sources

  • https://learn.microsoft.com/en-us/azure/search/retrieval-augmented-generation-overview
  • https://docs.aws.amazon.com/prescriptive-guidance/latest/retrieval-augmented-generation-options/introduction.html
  • https://www.ibm.com/think/architectures/patterns/genai-rag
  • https://arxiv.org/abs/2005.11401