Context engineering
What is Context engineering?
The practice of designing everything a model sees at the moment it runs: instructions, retrieved documents, tool definitions, conversation history. As AI moved from single prompts to agents working over many steps, wording one prompt well stopped being enough. It is the discipline prompt engineering grew into. The focus shifted from wording to wiring.
Why it matters
As soon as an AI system does more than answer a single question, its behaviour depends less on any one instruction and more on what you choose to put in front of it at each step. That turns out to be a design problem with real constraints. The context window is finite, every token added costs money and latency, and models get less reliable when you bury the relevant material in a wall of marginally useful text. So the craft is as much about what to leave out as what to include: which documents to retrieve, in what order, how much history to carry, when to summarise and drop the rest. Done poorly, an agent forgets what matters and fixates on what does not.
In practice
An assistant that answers policy questions works well in testing, then starts giving vague replies once real users hold long conversations. The cause is not the model but the context: transcripts have grown so long that the actual policy documents get crowded out. Trimming old turns, retrieving only the relevant sections and keeping the key rules pinned restores the quality. Same model, different information diet.