- History of messages - A list of prompts, responses, and tool calls.
- Fully typed state data - Typed state that allows you to build up structured data from agent calls, then implement deterministic state-based routing to easily model complex agent workflows.
History
The history system maintains a chronological record of all Agent interactions in your Network. Each interaction is stored as anInferenceResult
. Refer to the InferenceResult reference for more information.
Typed state
State contains typed data that can be used to store information between Agent calls, update agent prompts, and manage routing. Networks, agents, and tools use this type in order to set data:- Storing intermediate results that other Agents might need within lifecycles
- Storing user preferences or context
- Passing data between Tools and Agents
- State based routing
The
State
’s data is only retained for a single Network
’s run.
This means that it is only short-term memory and is not persisted across
different Network run()
calls.You can implement memory by inspecting a network’s state after it has
finished running.Using state in tools
State can be leveraged in a Tool’shandler
method to get or set data. Here is an example of a Tool that uses kv
as a temporary store for files and their contents that are being written by the Agent.