Brain labPlay → read → next · ~8 min

Tutorials · Chapter C (3/4) · ~8 min

Inside RAG — the pipeline

Play → read → next

RAG is a pipeline: embed the question → find chunks → put them in the prompt → generate.

Playground

Inside the RAG pipeline

Step through retrieve → augment → generate. Bad backpack = bad answer.

School rulesPhones stay in bags during class.
Cookie recipeBake cookies at 180°C for 12 minutes.
Store hoursWe open 9am–8pm every day.

Recap

What you just did

You walked the pipeline stages and saw how a broken step poisons the final answer — even if the LLM is strong.

Teach

How it works

A typical path:

  1. Embed the question
  2. Search your chunk store for nearest neighbors
  3. Pack the best chunks into the prompt (watch the suitcase!)
  4. Generate with instructions like “use only the notes”

Quality levers: better chunking, better search, clearer citations, and refusing to answer when nothing relevant was found.

Use it

When you'd use this

  • Debugging “why did the bot invent this?” (check retrieval first)
  • Designing a doc bot for a small team
  • Choosing what to store vs what to put in the system prompt

Watch out

Watch out

Fancy models won’t save garbage retrieval. Fix the backpack before you blame the writer.

Try next

Try this next

Name the stage you’d inspect first if answers cite the wrong product policy.