Foundations in Context Engineering

Lessons in this section

  1. 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.

  2. 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.

  3. 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.

  4. 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.