Who it’s for
You keep hearing “RAG” at work and in AI news, and you want to know what it actually is. No code and no maths: every idea comes with a picture, and the whole skill follows one story.
What you’ll be able to do
Explain RAG in plain words: a way of making an AI first search a set of documents, then answer from the few passages it finds. Say why it exists and how its parts work. Spot why it still gets things wrong, and know what to ask before you trust a tool that uses it.
How it works
Each lesson has two steps. Learn is a short explanation with one drawing. Dojo is a hands-on challenge with a small working help system inside the page. Both earn XP. Finish every lesson to claim your skill: free, with a PNG or PDF and a link anyone can verify.
Your task
Wonderloop Park opens for the summer soon. You lead its guest help line, and the park is adding an AI agent next to your team. Your job: get the agent ready for opening day. You’ll set it up and check its calls.
What’s inside
Wonderloop Park, its rides and its help system are invented for this skill. Nothing on this page calls a real AI: the search runs in your browser, and the agent’s answers are written in advance for each case.
It writes from memory
An AI model learned language from a huge amount of text during its training. When you ask it something, it writes the answer that fits the patterns it learned. It has never read your park’s papers.
It sounds sure either way
When it doesn’t know, it often fills the gap with something that sounds right. These invented, plausible statements are called hallucinations, and they can read just as confidently as the true parts.
Why it matters on a help line
A guest can’t tell which sentence was invented. A wrong height limit or opening time sends a family to the wrong place, or onto the wrong ride.
Look it up first
Before it answers, the agent searches the park’s help system with the guest’s question. The search hands back the few articles that match best.
Then answer from those
The agent reads only those articles and writes its answer from them, not from memory. That’s RAG: retrieval-augmented generation. Find the facts first (retrieval), then write (generation).
The search is a separate tool
The agent doesn’t carry the park’s papers in its head: the help system finds them and hands them over at answer time. Fix an article, and the next answer uses the new version. Nothing inside the AI changes.
Documents are cut into chunks
The help system doesn’t hand the agent whole documents. It cuts each one into short passages, called chunks, so the search can return just the part that answers the question.
Too small: facts come apart
Cut after every sentence, and “at least 120 cm” ends up in a different chunk from “Copper Coil”. The search finds the ride or the height, but not the two together.
Too big: pages of noise
Keep the whole guide as one chunk, and every question brings back all of it. The answer is in there, buried among every other ride.
Cut between sections Each chunk keeps a ride together with its height limit.
Cut in the middle “120 cm” loses its ride. A search for Copper Coil finds the first half only.
Meaning, not exact words
A parent asks about “toddlers”. The park’s papers never use that word: they say “children aged 0 to 5”. A search for the exact word finds nothing. A search by meaning finds Acorn Grove.
A map of meaning
The help system turns every chunk, and every question, into a list of numbers called an embedding. Texts about the same thing get similar numbers, so they sit close together. The search returns the chunks closest to the question.
Ours is simplified
Real systems learn meaning from huge amounts of text, and each embedding has hundreds or thousands of numbers. The search in this skill uses just 8 everyday topics, set by hand, so you can see it work.
Only the top few
The search ranks every chunk by how close it is to the question. Only the top few go to the agent. Anything below the cut-off never reaches it.
Too few: the answer is left out
Show too few, and the chunk with the answer can land just below the cut-off. The agent then has nothing to answer from.
Too many: noise and mix-ups
Show too many, and the agent reads more that doesn’t matter. Similar facts, like two rides’ height limits, can get mixed up.
No magic number
Teams test it on their own documents. In Anthropic’s tests, passing the top 20 chunks worked better than the top 5 or 10. That was their setup, not a rule.
One message, three layers
The agent doesn’t get the search results on their own. The help system builds one message for it, the prompt: the passages the search found, instructions, and the guest’s question.
Instructions set the rules
“Answer only from the articles below” tells the agent to use the park’s papers, not its general knowledge.
The question goes last
In Anthropic’s tests, putting the question at the end of a long prompt gave answers up to 30% better.
Say where each fact came from
A good RAG answer names the article behind each fact. These sources (or citations) let you check an answer in seconds.
No source? Check it
A sentence that no article supports didn’t come from the park’s papers. Check it or take it out before a guest hears it.
Sources help, they don’t guarantee
Asking for sources cuts down made-up answers, but doesn’t stop them. For anything important, open the article and look.
Acorn Grove is a play zone for children aged 0 to 5.1
A day ticket for a 4-year-old costs 39 euros.2
You can leave your pushchair next to the Guest Help Point.3
Sometimes the articles don’t say
The search still returns its best matches, even when none of them answers the question. A guest asks if the churros are nut-free. The food article lists churros, and says nothing about nuts.
A guess sounds just as sure
When models are graded only on getting answers right, a guess pays better than “I don’t know”, and it sounds just as sure. Telling the agent it may say it doesn’t know can cut made-up answers a lot.
Then hand it over
On a help line, “I don’t know” isn’t the end of the call. The agent says what it couldn’t find and passes the question to someone who knows.
✗It guesses
✓It says so and hands over
The search sent the wrong passages
A parent asks where lost property is and mentions their child. The search sends the lost-children passages of the right article, and the lost-property passage never reaches the agent.
An old article is still in
Last season’s opening hours were never removed. The search finds them next to this year’s, and the agent answers from the wrong one.
Two articles disagree
The ride guide says Fern Gorge is open every day. This week’s closures notice says it’s closed. Given both, the agent can pick either.
Check what reached the agent first
A study of three real RAG systems lists seven ways they fail. Four are about what the AI was given: the answer was missing, ranked too low, left out, or lost among noise and contradictions.
Paste it all in
For a few pages, skip the search: paste everything into the message. Anthropic suggests this when all your documents fit, up to about 500 pages.
Retrain the model
Fine-tuning trains the model further on examples. It changes how it writes: its tone, format and habits. It’s costly to redo, so it’s a poor way to keep changing facts up to date.
Plain search
A search box finds the right pages, but writes nothing. The guest still has to read them.
RAG sits in between
Search on every call, then write a short answer from what it found. Change an article, and the next answer changes too.
RAG
Searches the help system, answers from the top passages.
✓Right, short, with its source
Paste it all in
Every page of the park’s papers goes into the message.
✓Fine for a few pages, not for thousands
Fine-tuned
Trained on the park’s papers last winter, before the new hours.
✗The park’s tone, last season’s facts
Plain search
Lists the pages that match. Writes nothing.
- Opening hours 2026
- Closures this week
- Food and drink
~The guest reads and picks the right page
RAG is already at work
Company chatbots, and AI assistants that search your files, use the same idea: search first, then answer from what they found. Microsoft Copilot does it with your work files; Claude Projects switches it on when a project holds a lot of documents.
Only what you may see
A good assistant fetches only what the person asking is allowed to open. Microsoft says Copilot respects existing permissions, so it shows people only what they could already open.
Permissions are only as good as the sharing
If a file is shared with everyone by mistake, the assistant can find it too. Fix the sharing, not just the chatbot.
A quick check across the whole skill. Answer every question.
RAG terms
Every word from the skill, in plain English, with where you met it at Wonderloop Park.