What is Agent State?
Agent state is the structured data that an AI agent maintains across execution steps — including conversation history, task progress, accumulated results, and operational context needed to make informed decisions throughout a workflow.
WHY IT MATTERS
State is what makes agents coherent across multiple steps. Without state, each step starts from scratch. With state, the agent remembers what it's already done, what data it's gathered, and what decisions it's made — enabling complex multi-step operations.
In graph-based frameworks like LangGraph, state is explicitly defined as a typed schema that flows between nodes. Each node reads state, performs computation, and returns updated state. This makes state management transparent and testable.
For financial agents, state includes critical operational data: cumulative spending so far, pending transactions, positions held, and prices observed. Incorrect state (e.g., forgetting a previous transaction) can lead to duplicate payments or budget overruns.
HOW POLICYLAYER USES THIS
PolicyLayer tracks agent financial state independently — cumulative spending, transaction history, and budget consumption. This state is authoritative and tamper-proof, ensuring accurate policy enforcement even if the agent's own state is corrupted.