ML//agent//context engineering

Context engineering is the design of what a model is given to know at each exact inference step, and it is how an agent's harness keeps the right evidence in front of the model, where prompt engineering asks how to phrase an instruction.


Context engineering is the design of what a model is given to know at each exact inference step, and it is how an agent's harness keeps the right evidence in front of the model, where prompt engineering asks how to phrase an instruction.

For an agent, context may contain system instructions, conversation history, visible tool schemas, retrieved memory, project rules, tool observations, and summaries. These compete inside a finite context window.

The agent harness performs context assembly, the policy that constructs the model's perceived state at every step:

ct=AH(i,ht,mt,Tt,ot)c_t=A_H(i,h_t,m_t,T_t,o_t)ct​=AH​(i,ht​,mt​,Tt​,ot​)

It decides what to preserve, retrieve, summarize, truncate, or omit before the next generation. This policy can change behavior without changing model weights or the user's request.

The hard part is preserving causal and decision-relevant evidence while removing material that is stale, redundant, or likely to distract the next action. Maximizing the information included does not achieve that.