AI-ENGINEERING
    intermediate

    RAG (Retrieval-Augmented Generation)

    AI Engineer path · lesson 74 of 124
    The idea
    RAG is an open-book exam: instead of memorizing everything (retraining), the student looks up the relevant pages at question time and answers from them — citing the page.
    How to use
    Press Play to animate the retrieve → augment → generate pipeline and see the model answer with grounded citations.
    Query
    Retrieve
    Augment
    Generate
    Answer
    Press Play to run a retrieval-augmented generation pipeline.
    UserWhat is our refund window?
    Document store
    Our HQ is in Berlin; support is available 24/7.
    Refunds can be requested within 30 days of purchase.
    Refunds are issued to the original payment method in 5–7 days.
    Enterprise plans include a dedicated account manager.
    Digital goods are non-refundable after download.
    Augmented prompt
    — context not assembled yet —
    Answer

    …answers once context is retrieved.

    Key insight

    RAG doesn’t change the model’s weights — it puts the right evidence in the prompt at query time. The answer is grounded, current, and citable. Its ceiling is retrieval quality: the generator can only be as good as the chunks it’s given.

    Trace a RAG request

    Sequence

    Order what happens when a question arrives.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    5. 5Drop a step here
    6. 6Drop a step here
    6 pieces left to place

    Test your knowledge

    20 questions
    Question 1 of 20
    Score: 0

    What are the three core steps of RAG?

    The short version

    RAG is an open-book exam: instead of memorizing everything (retraining), the student looks up the relevant pages at question time and answers from them — citing the page.

    In more depth

    RAG

    RAG gives a frozen model fresh, private knowledge without retraining. At query time you retrieve relevant chunks (vector search), augment the prompt with them, and generate a grounded, citable answer. Because the output is built from retrieved text, hallucination drops and knowledge stays current. The quality ceiling is retrieval — bad chunks, bad answer.

    Interview Questions

    Anthropic
    Google
    Meta
    Notion
    Databricks
    Google
    Notion
    OpenAI
    Perplexity
    Notion
    Google
    Databricks
    Google
    Anthropic

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required