Log inStart free
LESSON 22.C3 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

The RAG pipeline end to end

One question runs through every step of a RAG pipeline, from files to answer.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 22.C3 · RAG BAY3 FILES · 14 BLOCKS · 2 REMOVED
01
Stage 1 of 6 · Parse and clean
Ingestion reads 3 files, and parsing removes the markup. Cleaning removes the nav bar and the footer.
Explain it simply

On the left you see the three help files as they arrive: Markdown, HTML and plain text. Parsing reads each format and keeps the words, so the grey marks go. The nav bar and the footer say nothing about the machine. Cleaning throws them away, so they cannot crowd out real text later.

Three files: manual.md, warranty.html and faq.txt. Parsing makes 14 blocks. Cleaning removes 2 blocks, the nav bar and the footer. 767 characters become 652.

file text, chunkscuts, settingsremoved, cut answerscores, answerindex links
Question: How often should I descale the machine?Raw files (ingestion)manual.md Markdownwarranty.html HTMLfaq.txt plain text# Brew Mini manual## BrewingFill the tank with cold water. Put 15 g of ground coffee inthe basket. Press start to brew one cup.## CleaningRinse the basket after each cup. Wash the drip tray once aweek in warm soapy water.## DescalingLimescale builds up inside the heater. Descale the machineevery 3 months. If your water is hard, descale it everymonth. Use descaling liquid, not vinegar.<nav>Home | Shop | Help</nav><h1>Warranty</h1><p>The Brew Mini has a 2 year warranty.</p><p>The warranty does not cover damage from limescale.</p><footer>(c) 2026 Brew Co. All rights reserved.</footer>Q: Can I use vinegar to descale?A: No. Vinegar can damage the seals. Use descaling liquid.Q: Why is my coffee weak?A: Use more ground coffee or a finer grind.Blocks after parsingtitleBrew Mini manualheadingBrewingtextFill the tank with cold water. Put 15 g of …headingCleaningtextRinse the basket after each cup. Wash the d…headingDescalingtextLimescale builds up inside the heater. Desc…nav barHome | Shop | Help · removedheadingWarrantytextThe Brew Mini has a 2 year warranty.textThe warranty does not cover damage from lim…footer(c) 2026 Brew Co. All right… · removedQ and AQ: Can I use vinegar to descale? A: No. Vin…Q and AQ: Why is my coffee weak? A: Use more groun…767 characters in → 652 clean characters outQuestion: How often should I descale the machine?Raw files (ingestion)manual.md Markdownwarranty.html HTMLfaq.txt plain text# Brew Mini manual## BrewingFill the tank with cold water. Put 15 g of ground coffee inthe basket. Press start to brew one cup.## CleaningRinse the basket after each cup. Wash the drip tray once aweek in warm soapy water.## DescalingLimescale builds up inside the heater. Descale the machineevery 3 months. If your water is hard, descale it everymonth. Use descaling liquid, not vinegar.<nav>Home | Shop | Help</nav><h1>Warranty</h1><p>The Brew Mini has a 2 year warranty.</p><p>The warranty does not cover damage from limescale.</p><footer>(c) 2026 Brew Co. All rights reserved.</footer>Q: Can I use vinegar to descale?A: No. Vinegar can damage the seals. Use descaling liquid.Q: Why is my coffee weak?A: Use more ground coffee or a finer grind.Blocks after parsingtitleBrew Mini manualheadingBrewingtextFill the tank with cold water. Put 15 g of …headingCleaningtextRinse the basket after each cup. Wash the d…headingDescalingtextLimescale builds up inside the heater. Desc…nav barHome | Shop | Help · removedheadingWarrantytextThe Brew Mini has a 2 year warranty.textThe warranty does not cover damage from lim…footer(c) 2026 Brew Co. All right… · removedQ and AQ: Can I use vinegar to descale? A: No. Vin…Q and AQ: Why is my coffee weak? A: Use more groun…767 characters in → 652 clean characters out
Toy: 3 help files and 1 question. The cross-encoder and the LLM are hand-set stand-ins.
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
blocks=parse(file)∖{nav,footer}\sy{b}{data}{\text{blocks}} = \text{parse}(\text{file}) \setminus \sy{bp}{grad}{\{\text{nav}, \text{footer}\}}
14−2=12 blocks, 767→652 characters14 - 2 = 12\ \text{blocks},\ 767 \to 652\ \text{characters}

Parse each file into blocks, then remove the boilerplate blocks.

Common mix-ups

MYTHA reranker can repair a chunk that cuts the answer.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With recursive chunks, does the answer keep both answer sentences?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.