State is the structured working data an LLM-based system maintains about its current task, user, and environment. Kept outside the model by the agent harness or application, it changes as the workflow progresses. A context manager reads it to select the information needed for the next context window. section 1.5.5 section 5.3
State differs from short-term memory: memory records what was said and done, while state tracks operational variables such as goals, progress, and collected parameters. Long-term memory retains information for retrieval across sessions. Frameworks may combine or separate these abstractions. section 5.1.3
Listing 1.1 State in a travel-planning agent
{
"task": "trip_planning",
"destination": "Tokyo",
"flight_search_completed": true,
"selected_flight": "JL001",
"hotel_search_in_progress": true,
"budget": 1800
}
A travel-planning state object tracks the destination, budget, selected flight, and hotel-search progress. After a hotel is chosen, the orchestrator can update the search flag and add the selection. section 1.5.5
A state schema can organize variables by their role:
- User state: intent, expertise, sentiment, and active preferences. section 5.3.1
- System state: enabled tools, reasoning budgets, error counts, and resource flags. section 5.3.1
- Dialogue state: collected fields, cart contents, and verification steps. section 5.3.1
- Environmental state: API responses, cached records, workspace paths, and background notifications. section 5.3.1
- Multi-agent state: assignments, peer progress, dependencies, and shared deliverables. section 5.3.1
Representations include typed schemas, in-memory scratchpads, and state derived from append-only event streams. Explicit fields make updates more predictable and auditable; the appropriate representation depends on the application architecture. section 5.4.1 section 5.3.1
State updates can come from several places:
- Graph nodes return updates that reducers overwrite, append, or merge into fields. section 5.4.2
- Application code updates flags after tool execution, such as confirming a successful payment. section 5.4.2
- A model proposes patches through state-modification tools or structured output; the harness validates them before applying them. section 5.4.2
Reliable management also requires propagation, selection, and persistence alongside representation and update. Deterministic update handling helps prevent race conditions and invalid transitions. section 5.4 section 5.4.2



















































