Foundations in Context Engineering
Lessons in this section
- Context Basics
What context is, why a model only knows what is in its context window, how context engineering differs from prompt engineering, the 14 parts a context can hold, and why good context gives better answers.
- Context Windows
How text becomes tokens, how big the context window is, why the reply needs its own budget, why facts in the middle of a long context get missed, and how sampling settings work with the context.
- Context Selection
How to decide what goes into a context: include, exclude, summarize, or retrieve on demand. The minimum context principle, evidence sufficiency, speed and cost, and stable versus dynamic context.
- Context Formatting
How to label and separate the parts of a context with headings, XML tags, and delimiters, keep instructions apart from data, defend against prompt injection, and place rules, schemas, and sources.