Context: What the Agent Sees This Step, and What It Does Not
More context is not always better. A stale to-do snapshot almost made my agent wrong with full confidence. Here are the five steps of context assembly, and why Trim matters.
One day, North got a to-do snapshot that was 4 days old. It said, “Three tired days in a row, so reduce the load today.”
North saw that the snapshot did not cover the last three days, so it did not use it. It told me the data was stale. Only then did I see how close it came to being wrong with full confidence.
The five steps of context
More context is not always better. The talk by 「大大帶我飛」 splits context assembly into five steps:
The step people skip most is Trim. Data that still exists is not always data that is still right.
Three tiers of memory
The talk also splits memory into three tiers:
- Task state: what this run is doing, which tools it called, and what comes next.
- Session memory: which files this conversation read, and its short-term assumptions.
- Long-term memory: user preferences, project conventions, and lessons from past tasks.
The stale snapshot was short-term data that leaked into today’s context.
What I learned
Every piece of data needs to carry the time it was made. Then the agent can tell whether it is stale.
A better fix is to not make the agent judge this every time. After that day, I turned it into a rule: when a snapshot is too old, the script does not send it into the context at all. This is the graduation that Graduate NFR into FR describes. Context is one layer of the harness, as The Harness Is the Agent’s Workplace shows.
Every piece of data in the context must answer one question: is it still right?
References:
- A talk by 「大大帶我飛」
Related: see how the stale snapshot rule graduated in Graduate NFR into FR, revisit The Harness Is the Agent’s Workplace, or go back to the series overview: Design an Agent.