Martin Keen uses a database-driver migration to explain context engineering: choosing what information an agent receives at each step. His ten-minute IBM Technology walkthrough connects four failures to specific remedies.
What fills the window (01:50)
- The task itself may be only a few lines. System instructions, project guidance, tool descriptions, message history and tool results occupy the rest.
- File contents, test output, logs and database schemas accumulate as the agent works. A larger window provides capacity; it does not guarantee that the model uses every detail reliably.
Poisoning: validate conclusions before saving them (04:35)
- The migration agent misreads documentation and writes a note claiming the new driver automatically retries failed connections. It then deletes working retry code throughout the project.
- Check consequential conclusions against evidence before saving them as reusable facts. Keen’s example needs a connection test, not another confident note.
Distraction: compact history, retain evidence elsewhere (05:20)
- A long history can steer the agent toward repeating previous actions instead of choosing what the current task needs.
- Replace the running log with a shorter account of the current task and progress. Keep detailed evidence in files that can be reopened when needed.
- Summaries lose information. Keen compares repeatedly summarizing a summary to making a photocopy of a photocopy.
Confusion: expose fewer tools (06:03)
- Tool descriptions consume context even when the tools are unused. A large menu also makes selecting the correct action harder.
- Offer the tools needed for the current task and discover additional ones on demand.
- Keen cites a benchmark where one task failed with 46 tools and passed with 19. That example supports testing tool selection; it does not establish an ideal tool count.
Clash: remove superseded instructions (06:55)
- Correcting the retry mistake leaves both the original note and its correction in the history. The model now sees incompatible accounts of the same behavior.
- Remove the obsolete claim from active context, or start a fresh window with the corrected task state. Appending a correction is not always enough.
“An agent can get better at long tasks, by holding less.” — Martin Keen, 09:54