Understanding Flow History
In ControlFlow, eachFlow
maintains its own conversation history. This history includes all the interactions, decisions, and outputs generated during the execution of tasks within that flow. By default, this history is used to provide context for subsequent tasks, allowing for coherent and context-aware conversations.
Creating and Managing Threads
Creating a New Thread
When you create a newFlow
, it automatically generates a new thread with a unique ID. This thread isolates the conversation history for that particular flow.
Specifying a Thread ID
You can also create a flow with a specific thread ID, which is useful for resuming conversations or creating deterministic threads:Resuming a Conversation
To resume a previous conversation, you can create a new flow with the same thread ID:Creating Private Sub-Threads
Sometimes you may want to create a private conversation that doesn’t affect the main thread. You can do this by creating a new flow within your current flow. The events in the private flow won’t be visible to the parent flow.Managing History Across Flows
Inheriting Parent Flow History
By default, when you create a new flow within another flow, it inherits the history of its parent:load_parent_events=False
: