Skip to content

ExpertLesson 1 of 411 min read

Context is a finite resource

A course from the Academy: Context engineering: what your agent sees

Go to the quiz ↓

For two years, everyone talked about prompt engineering: writing the instruction well. With agents that work through dozens of steps, the question has changed scale. At each step, the model receives a whole package: the system prompt, the definition of each tool, the entire history, every tool result, the retrieved documents. What decides quality is the composition of that package. The term now is context engineering.

More context, less attention

The Beginner level showed that the middle of a long text is read less well. Measurements published since go further: on many models, performance degrades as the context grows longer, including on simple tasks and well below the advertised limit. A large window is a capability, not an invitation to fill it. The right goal is the opposite: the smallest set of information that is enough to do the next step well.

What inflates an agent's context

  • Raw tool results. A search that returns a 40 KB JSON of which three fields are used, an entire web page with its menus and footers.
  • Tool catalogues. Connecting ten MCP servers often means fifty or a hundred tools whose descriptions take up thousands of tokens on every call, and a model that hesitates more between neighbouring tools.
  • Failed attempts piling up, files read three times, endless command outputs.

What it costs

The "After launch" course put a figure on it: the context is sent again at every step. A forty-step agent whose context swells pays forty times over for the same tool results, with latency growing accordingly. Quality, cost and speed all point the same way here: trimming helps all three.

The first levers

  • Tools that return little: the useful fields, pagination, a summary rather than the full object, error messages that say what to do.
  • Few tools, clearly distinct: if a human hesitates between two tools when reading their descriptions, the model will hesitate too.
  • References rather than content: keep a file path or a document identifier, and only read it again when it is needed.
Analogy. A surgeon does not operate with the hospital's entire stock laid out around them. The theatre nurse prepares the tray for the procedure and hands over each instrument at the right moment. Context engineering is that nurse's work: not fewer instruments available, fewer instruments on the table.

Key points

  • What the model sees at each step decides quality: that is the subject of context engineering.
  • Performance drops as the context grows longer, well before the advertised limit.
  • Concise tool results, a reduced tool catalogue, references rather than content.

Key concepts

Complete the lesson

A 4-question quiz: 3 correct answers are enough, plus an exercise to practise. It opens in the Academy, on this same lesson.

Take the quiz and complete the lesson Free. With an account, your progress is saved and leads to the course certificate.

The course: Context engineering: what your agent sees

  1. Context is a finite resource11 min
  2. Un contexte stable, pour le cache et pour la cohérence11 min
  3. Compacter, prendre des notes, rappeler l'objectif12 min
  4. Sous-agents : isoler pour mieux penser11 min

The whole Academy →The AI glossary