In short
An agent reviewing a refund request makes several calls to the model before it finishes the task. On each one, some part of the system decides what the model receives: the instruction, the policy in force, the customer's history, the result of the previous tool, the list of available actions. Context engineering is the discipline that makes that choice on every call. The quality of the answer and the cost of each run depend on it, and it rests on the Company Brain, the layer that knows the company (what data exists, where it lives, how it connects and who may see what).
A language model works only with what is in the context window at the moment of the call. Whatever stays outside the window plays no part in the answer. Context engineering treats that window as a limited resource and designs, for each step, the set of information the task requires.
The work comes down to four operations. Selecting which part of the policy goes in. Ordering, so that the instruction and the main data sit in a prominent position. Summarising the history of a long task. Discarding the result of a tool that has already done its job.
Prompt engineering is about how the instruction is written: how to phrase the task, which examples to include, which output format to ask for. It works well when the task fits in one question and one answer and the knowledge needed is already in the text being sent.
Context engineering includes that instruction and takes care of everything that reaches the model along with it: data retrieved from systems and documents, history, tool descriptions, results of earlier calls and memory of past interactions. In an enterprise agent, the instruction usually takes up the smallest part of the window.
The term gained ground when projects moved from isolated questions to agents that run sequences of steps. Each step adds a tool result to the history, and the window grows at every stage. Without a rule, the last call carries the leftovers of all the ones before it.
Larger windows ease the space limit and bring two side effects. The first is cost, because every token sent is billed on every call. The second is quality. In 2023, Liu and colleagues showed that model performance drops when the relevant information sits in the middle of long contexts, including in models designed for long windows. More text in the window can dilute the very passage that decides the answer.
A call from an enterprise agent combines five components:
Each component ages at its own pace. The instruction changes with each version of the agent, the history is valid for the task in progress, and data from a system can change between one call and the next.
Errors usually start at one of these four points:
In enterprise agents, most input tokens come from the context, because the instruction is short while retrieved data, history and tool descriptions are long. Every unnecessary passage is paid for on every call and at every step of the agent.
A lean context has a second effect. When the information arrives resolved and free of conflict, the task asks less of the model, and many steps can run on smaller, cheaper models.
Context engineering depends on knowing, for each question, what data exists, where it is, which version is valid and who may see it. When that answer is built inside each agent, every project redoes the same integration.
In the Company Brain, this work lives in a shared layer. The knowledge graph links the refund request to the customer, the original purchase and earlier tickets. The business ontology defines which policy applies to that type of purchase. The semantic layer translates the question into the right query and returns only the slice that is needed, with permissions inherited from the source system and the source of each piece of information.
That slice is served to the agent over MCP, the open protocol that connects models to data sources. The window receives less text, with no conflicting values and in the current version, and the next use case reuses the same context.
The first practical step is to record, for an agent in production, what goes into each call: how much comes from the instruction, from retrieved data, from history and from tools, and which passages actually show up in the final answer.
Passages that go in and are never used point to excess. Wrong answers caused by a conflicting or stale source point to where the first Company Brain slice should start. With that slice in place, context engineering for each new agent starts from a layer that already handles sources, versions and permissions.