AI Hints
Home›RAG Tutorial›Cleaning and Chunking
RAG · Lesson 17 of 120

Why Chunk

Small pieces find better.

⏱ 2 min read▶ Video at 16:42🎓 Free
Watch this lesson in the RAG courseWatch on YouTube ↗Full RAG course

Why not search whole documents? Because a long page covers many topics. Its meaning gets blurred, so it matches questions poorly. And sending whole pages to the model wastes space, and hides the one line that matters.

Why Chunk
From the video: Why Chunk
  • Long pages blur meaning
  • Poor matches
  • Wasted prompt space

Whole page or chunk?

A whole page about returns talks about change of mind, faulty items, and refund timing, all at once. A chunk holds just one of those ideas. A question about refund timing matches that chunk sharply, and the model gets exactly the facts it needs.

Whole page

  • Many topicsBlurred meaningLong prompt

One chunk

  • One ideaSharp matchShort prompt

Chunking goals

A good chunk is small enough to hold one idea, but big enough to make sense on its own. It shouldn't cut a sentence in half. And it should keep a note of where it came from.

keyvalue
Smallone idea
Completemakes sense alone
Clean cutsno half sentences
Labelledsource kept

Summary

We split documents into chunks, so each piece holds one idea, matches sharply, and fits neatly in the prompt. Next, fixed size chunks.

Key takeaways
  • One idea per chunk
  • Sharper search
  • Smaller prompts
Next up: Fixed-Size Chunks — size and overlap