Codele / LLMs, RAG and agentic AI
Chunking and retrieval quality
Before a computer can search a long document, the document is cut into pieces. The size of the pieces decides what search can find. Pick a cut and watch.
- A chunk is one piece of a document. Search finds chunks, not whole books.
- Chunks that are too small cut facts in half. The answer is split and search misses it.
- Chunks that are too big bring noise: lots of unrelated words that crowd the prompt.
- Overlap repeats a few words between neighbouring chunks, so a fact on the edge stays whole in at least one.
- This toy counts matching words. Real search uses embeddings, but the chunk-size problem is the same.
Loading the playable lesson…