Skip to content
estudIA

AI glossary

Context engineering

Choosing what goes into a model’s context at each step (instructions, documents, tool results, memory) so it has what it needs and nothing more.

Prompt engineering is about how you phrase a request. Context engineering is the wider job of curating everything the model sees, which matters most for agents that run for many steps. Too little context and the model guesses; too much and it gets slower, more expensive and easier to confuse.

Common techniques: retrieving only the relevant documents (RAG), summarising old steps, giving subagents their own context, and keeping long-term notes in a memory file.

Example: A support assistant does not get all the company’s documentation, just the three most relevant articles, the customer record and the reply guidelines. It answers better, and more cheaply, than with the whole manual pasted in.

In practice

  • Ask yourself what a new colleague would need to know to do the task well, and give the model that.
  • Remove what adds nothing: noise distracts the model and costs tokens.
  • Keep the start of the prompt stable to benefit from prompt caching.

We apply it to agents in agent design patterns.

Related terms

Learn more

← Back to the glossary