Press Play to see one sentence become three chunks. Two cut lines appear, then the original text pieces lift away from the page. Every word, space and punctuation mark stays in its source order. The cut points are handpicked for this small demonstration.
Chunking divides source material into pieces that can be indexed and retrieved separately. A useful chunk keeps enough context to stand on its own. Here, the later pieces no longer name Northbank. This makes a simple limitation visible: preserving every character does not guarantee that each separate piece makes sense.
Real document pipelines can use sentence, paragraph, fixed-size or semantic boundaries. Larger chunks, overlap or added source context can help preserve relationships across a cut. The appropriate choice depends on the material and the questions readers ask. This animation illustrates the mechanism; it does not run an embedding model or choose an optimal production chunk size.
Sources and model assumptions
Follow the original mechanism behind this explainer. The interactive examples identify their toy data and simplifying assumptions above.
Put it to work
Related terms
- Context windowThe context window is the maximum amount of text, measured in tokens, that a model can consider for a single request. It is a hard ceiling, and it is the main resource you manage when working with an agent.
- ContextContext is all the text a model can see for a single request: the system prompt, your message, the conversation so far, and any files or tool output the agent has pulled in. It is the only thing the model knows about your specific situation.
- ChunkingChunking is splitting a long document into smaller pieces before you embed and retrieve them. The size and overlap of the chunks decide what can be found as a unit, so it quietly makes or breaks a retrieval system.
- Retrieval-augmented generation (RAG)RAG is the workhorse pattern of context engineering: retrieve the material relevant to a request, put it in the context, and let the model generate an answer grounded in it rather than guessing from memory.
- EmbeddingsAn embedding turns a piece of text into a list of numbers that captures its meaning, so that similar ideas land near each other. Embeddings are what let you search by meaning instead of by exact keyword.