Leverage a Network’s State across Routers and Agents.
State
class provides a way to manage state and history across a network of agents. It includes key-value storage and maintains a stack of all agent interactions.
The State
is accessible to all Agents, Tools and Routers as a state
or network.state
property.
state.data
)State
class provides typed data accesible via the data
property.
history
to the lifecycle hooks and via the network
argument to the Tools handlers to the Router function.
The State history can be retrieved - as a copy - using the state.results
property composed of InferenceResult
objects:
InferenceResult
class represents a single agent call as part of the network state. It stores all inputs and outputs for a call.
Message
Types