Skip to content
unmagic.ai

Concept 05 · 8 min

It hasn’t read your documents. Unless someone hands it the right pages, right before it answers.

Scroll to start

Scene 1

Closed book, open book

Mr. Miller wants his overdraft raised to €18,000. Sarah asks the assistant whether she can approve it herself.

Add the right pages to its prompt, and compare the answers.

Prompt: the question alone

Sarah

Can I approve Mr. Miller’s overdraft increase to €18,000 myself?

Assistant

No, I cannot approve overdraft increases. Please escalate this to your manager or the relevant department for authorization.

Without your pages, the LLM answers from what it learned in training: generic, and no use to your bank. Adding the right pages to its prompt, in its context window, right before it answers, is called RAG, retrieval-augmented generation. The hard part: finding the right pages.

Scene 2

The librarian

Your bank has thousands of pages, and its context window holds a few. Same question: scroll to follow the RAG search through the shelves.

RankDocumentRelevanceCited as
1Miller Joinery client file1
2Overdraft policy (2026) · §32
3Overdraft policy (2026) · §13
4Overdraft policy (2026) · §2
5Complaints procedure
6Fee schedule (2026)
7Miller Joinery client file
8Fee schedule (2026)
9Complaints procedure
10Cafeteria menu, week 40
11Cafeteria menu, week 40
Yes, you can approve the increase to €18,000 under §3 of the Overdraft Policy (2026), as the limit remains below €20,000 and the overdue invoice is only 12 days late 23.
RankDocumentRelevanceCited as
1Miller Joinery client file1
2Overdraft policy (2026) · §32
3Overdraft policy (2026) · §13
4Overdraft policy (2026) · §2
5Complaints procedure
6Fee schedule (2026)
7Miller Joinery client file
8Fee schedule (2026)
9Complaints procedure
10Cafeteria menu, week 40
11Cafeteria menu, week 40
Yes, you can approve the increase to €18,000 under §3 of the Overdraft Policy (2026), as the limit remains below €20,000 and the overdue invoice is only 12 days late 23.

The search kept the three closest passages and added them to the prompt, in the context window; the answer cites each one with a number: a citation you can open. That’s RAG: search first, then answer.

Scene 3

How many passages?

The search ranks every passage of the library, the archived 2023 policy included. How many should RAG hand over?

Slide to choose how many passages it gets, and watch the answer.

Handed over · 3/11

  1. 1Miller Joinery client file
  2. 2Overdraft policy (2026) · §3
  3. 3Overdraft policy (2026) · §1
  4. Overdraft policy (2026) · §2
  5. Complaints procedure
  6. Fee schedule (2026)
  7. Miller Joinery client file
  8. Fee schedule (2026)
  9. Complaints procedure
  10. Cafeteria menu, week 40
  11. Cafeteria menu, week 40

Assistant

Yes, you can approve the increase to €18,000 under §3 of the Overdraft Policy (2026), as the limit remains below €20,000 and the overdue invoice is only 12 days late .

RightHis file and the 2026 rule: the right answer, cited.

Scene 4

Curate the library

Now you run the RAG. Choose which documents are on the shelves, pick a question, and run the search.

Challenge

  • Get the right answer to Mr. Miller’s request, with the right sources.
  • Bonus: make it cite a source and still be wrong.

Choose the documents on the shelves and a question, then run the RAG search.

On the shelves

Always there: Fee schedule (2026) · Complaints procedure

Question

Nothing searched yet.

RAG only finds what’s on the shelves, and can’t tell a current page from an archived one. Unlike a hallucination, this wrong answer comes from a real page: an outdated one. Keep the library clean.

Scene 5

The RAG pipeline, step by step

Here is what a RAG system does behind the scenes, in order. Scroll: the diagram moves forward, and the trace shows what each part passes to the next.

StepPartWhat it passes on
1PromptSarah’s question
2Retrieverthe question’s meaning, compared with every passage
3Best resultsthe 3 closest passages
4Context windowinstruction + numbered passages + question
5LLMan answer that cites its sources
6Answerthe answer, with sources to open

The prompt sent to the LLM:

Answer only from the sources below and cite them like [1]. If they don’t contain the answer, say so.

[1] Miller Joinery client file: Overdraft limit: €10,000. Mr. Miller has asked to raise it to €18,000. One invoice is 12 days overdue.
[2] Overdraft policy (2026) §3: Approval: relationship managers may approve business overdraft limits up to €20,000, provided no invoice is more than 30 days overdue. Above €20,000, the credit committee decides.
[3] Overdraft policy (2026) §1: Scope: this policy covers authorised overdrafts on business current accounts.

Can I approve Mr. Miller’s overdraft increase to €18,000 myself?
Yes, you can approve the increase to €18,000 under §3 of the Overdraft Policy (2026), as the limit remains below €20,000 and the overdue invoice is only 12 days late 23.
StepPartWhat it passes on
1PromptSarah’s question
2Retrieverthe question’s meaning, compared with every passage
3Best resultsthe 3 closest passages
4Context windowinstruction + numbered passages + question
5LLMan answer that cites its sources
6Answerthe answer, with sources to open

The prompt sent to the LLM:

Answer only from the sources below and cite them like [1]. If they don’t contain the answer, say so.

[1] Miller Joinery client file: Overdraft limit: €10,000. Mr. Miller has asked to raise it to €18,000. One invoice is 12 days overdue.
[2] Overdraft policy (2026) §3: Approval: relationship managers may approve business overdraft limits up to €20,000, provided no invoice is more than 30 days overdue. Above €20,000, the credit committee decides.
[3] Overdraft policy (2026) §1: Scope: this policy covers authorised overdrafts on business current accounts.

Can I approve Mr. Miller’s overdraft increase to €18,000 myself?
Yes, you can approve the increase to €18,000 under §3 of the Overdraft Policy (2026), as the limit remains below €20,000 and the overdue invoice is only 12 days late 23.

Prompt, search, best results, context, answer: every RAG system follows these steps. When an answer is wrong, one of them failed, most often the search.

Hype vs reality

  • What the hype says

    “We trained the AI on our documents.”

    What actually happens

    Usually not: it searches them when you ask and reads a few passages. Remove a document and the knowledge is gone.

  • What the hype says

    “It has read all our documents.”

    What actually happens

    It reads the handful of passages the search returns. If the search misses the right page, the answer misses too.

  • What the hype says

    “With sources, no more hallucinations.”

    What actually happens

    Sources make hallucinations rarer and errors checkable. An outdated page, cited perfectly, is still wrong.

Under the hood

In 3 sentences

  1. RAG means search first, then answer: a few relevant passages go into the LLM’s context window, with your prompt.
  2. It answers from those passages and cites them, so you can check.
  3. The answer is only as good as the library and the search: outdated or missing pages mean wrong answers.

Did this make sense?

Recorded with Ministral 3 (8B), EmbeddingGemma (300M), Oct 9, 2026.

1. LLM
2. Context
3. Prompt
4. Hallucinations
5. RAG
6. Tools
7. Agent
8. Skills
9. Limits & safety
Home: the journey
For teams
Lire en français
Theme: light
Theme: dark
Theme: follow the system
↑↓ to move · ↵ to open · esc to close