Understand context length limits, lost-in-the-middle effects, and strategies for working within or around token budgets.
Five passes over the same idea, each from a different angle. Do them in order, or jump to whichever you need.
Context window is the maximum token count a model can process. Models range from 4k to 1M+ tokens. Longer context enables whole-codebase analysis and book-length documents. However, quality degrades in the middle of long contexts ("lost in the middle"). Strategies include chunking, RAG, summarisation chains, and context compression.