Workflow state management
A cognitive architecture can be thought of as a connected graph, with designated entry and exit points. Each node within the graph represents a specific task, ranging from simple post-processing to a complex, self-contained agent. The edges of the graph represent the transitions between two different tasks.
The application begins with an initial state, which is fed into the entry point of the graph. Each node processes and potentially modifies this state as it travels through the graph. Finally, upon reaching the exit point, the final state is returned as the output. In most applications, the state is represented as a list of messages, but it can be any data structure based on the application’s specific needs.
To create dynamic behavior that responds to the application’s state, we can use conditional edges. These structures guide the flow to different nodes based on the application’s current state when it reaches that point in the...