StoryboardAI Engineering

Context engineering

Deciding what goes into the model's window at each step, and what stays out.

What is context engineering?

An agent's window fills with everything it has done: its requests, every file it read, every test result. Left alone, a long job hits the limit. Before that, quality drops, because the model starts overlooking things in a very full window.

Context engineering is the set of habits that keep the window useful. Clear tool results that are no longer needed. Keep notes in a file outside the window. Load information when it is needed rather than all up front.

The goal is not the fullest window but the most relevant one: the smallest set of text that lets the model take the next step well.

A window arranged on purpose.1. Fixed instructions and tools: first: never change. 2. Reference material for this question: only what is needed. 3. Conversation: old turns summarised. 4. The key rule, repeated: near the end. 5. The question: last.Fixed instructions and toolsfirst: never changeReference material for this questiononly what is neededConversationold turns summarisedThe key rule, repeatednear the endThe questionlast
A window arranged on purpose.

Why does context engineering matter?

A model's answer depends entirely on what it was shown. Most wrong answers in real products are caused by the wrong text being in the window, or the right text being buried, and not by the model being incapable. Deciding what goes in, in what order and how much is the main skill of building with models.

How does context engineering work?

  1. List everything that could go in the window: instructions, tools, documents, memory, conversation, tool results.
  2. For each request, choose only what this reply needs.
  3. Order it deliberately: fixed parts first, the question last, key facts away from the middle.
  4. Label each part so the model can tell instructions from material.
  5. Set a budget per part, and trim in a fixed order when the total is too large.

When should you use context engineering?

Use it when

  • A prompt draws on several sources
  • Answers are wrong although the information exists somewhere
  • Conversations or agent runs get long

Think twice when

  • The whole task is one short question and answer

Where does context engineering sit in a real system?

It is the work of the prompt builder inside your harness. It runs before every model call and decides the exact text that call will contain.

What goes wrong with context engineering?

  • Adding more text to be safe. Extra text lowers quality.
  • Loading everything in advance when a tool could fetch it on demand.
  • Stating the same rule in three places, slightly differently.

What does context engineering look like in practice?

Of fifty wrong answers from a shop's assistant, the needed text was missing from the window in 31, present but buried or contradicted in 12, and the model itself slipped in 7. Fixing what was put in the window fixed most of them without touching the model.

Watch it happen

These stories show context engineering at work, one step at a time.