Context Engineering

Context engineering is the practice of deciding what information a language model sees in its context window at each step of a task. It covers the system prompt, tool definitions, retrieved documents, memory, and the running message history, and treats their selection, order, and size as design decisions. Prompt engineering focuses on how an instruction is worded, while context engineering manages the whole set of tokens around it, much of which code assembles at runtime. In agentic systems the context changes on every turn of the loop, so long-running agents need rules for what to keep, summarize, fetch on demand, or drop.

Common techniques include retrieving only the passages relevant to the current step, loading tool descriptions or reference files on demand, compacting older history into a summary, and delegating side tasks to subagents that return a short result instead of their full working context. Model accuracy tends to decline as context grows long and cluttered, an effect sometimes called context rot, so adding more material is not a safe default. The term spread in 2025 as agent builders began describing many failures as context problems rather than problems with prompt wording.

Work with us

Ready to put agentic AI to work?

Book a free 45-minute consultation. We'll map one real process worth automating with production-grade AI.