Mid-level interview question
What belongs in harness state rather than the context?
Model answer
Anything that must be exact or must survive: IDs processed, refunds already issued, lists, queues. Structured data stays structured in code; in a context it's just text.
Scroll sideways to see the whole diagram
The context should hold what the next decision needs: the task, a summary, recent results.
Text version
- The context should hold what the next decision needs: the task, a summary, recent results.
- Everything else can live in the harness: a state object, a database, a notes file the agent writes to.
- AI Engineering notes text in a context is unstructured; a memory system that stores structured data, like a spreadsheet of leads or a queue of actions, keeps its structure.
- Anthropic describes keeping lightweight identifiers, such as file paths or stored queries, and loading data with tools at run time, rather than loading everything up front.
Load details just in time with tools, keeping lightweight identifiers in the context.
Practise the rest
6 Agent memory questions, 492 in all, each with a model answer. Free.
More Agent memory interview questions
- What kinds of memory does an AI agent have?
- What goes wrong if the harness just drops the oldest messages when the context fills?
- How do you keep a long run within its context without losing what matters?
- Your context fits the window. Why might you still manage it?
- How would you design a handoff to a sub-agent?