The model has no state; the tools do
The model is a function from messages to messages. Any state — current draft, partial form, in-progress order — lives outside, accessed via tools. This split is the point of agent design: stateless model, stateful environment.
Stateful-tool patterns
- Drafts —
create_draft,update_draft,send_draft. Model can iterate without re-stating the whole draft each turn. - Sessions —
start_session,step_session,finish_session. The session id is the handle. - Carts / forms — entity has its own lifecycle; tools mutate it; model navigates by id.
Why this beats packing everything into context
- Less context = lower cost, faster response.
- Auditable state changes (the tool calls are the diff).
- Resumable — close the conversation, come back, pick up the draft.
- Concurrent — two agents can act on different parts of the same state.