Chunking strategies
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
split documents into chunks that retrieve well.
Planned topics
- Chunk: the unit you embed and retrieve. Too large drowns the answer and wastes tokens; too small loses context.
- Start with structure: split by headings and paragraphs, then by size (a few hundred tokens is a common start; tune by measurement).
- Overlap a little so a sentence at a boundary is not cut off.
- Metadata per chunk: article id, title, section, language, product, audience, updated time.
- Keep the article id so one article can be re-indexed alone.
Draft outline details
Demonstration
a returns policy article split into "Eligibility", "Deadlines", "Refund method" chunks, each carrying {articleId: 42, lang: "en", section: "Deadlines"}.
Check your understanding
Why keep the article id on every chunk?
Show answer
To cite the source and to replace only that article's chunks on change.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.