Tutorials · Chapter C (3/4) · ~8 min
Chunking for RAG quality
Try it → see it → read → next
Split documents into right-sized pieces — too small loses context, too large retrieves noise.
Try yourself
Playground
Chunk size changes retrieval
Pick a chunk size, then ask about annual plan refunds. Medium chunks usually win.
Question: Can I get a refund on an annual plan?
Recap
What you just did
You changed chunk size and watched which piece similarity search retrieved for the same question.
Teach
How it works
Chunking breaks long docs into embeddable pieces. Good chunks:
- Fit one idea or section when possible
- Include overlap so sentences split across boundaries still retrieve
- Carry metadata (source, page, heading)
Too tiny → fragments without context. Too huge → wrong section wins. Start around 300–800 tokens and tune with real questions.
Use it
When you'd use this
Watch out
Watch out
Tables and lists often need to stay in one chunk. Always test with your user questions, not generic ones.
Try next
Try this next
Open the How to chunk documents for RAG recipe on the reference shelf.