- Validating sensitive operations
- Reviewing tool calls before execution
- Gathering user input for decision-making
- Managing external tool execution
Types of Human-in-the-Loop Flows
Agno supports four main types of human-in-the-loop flows:- User Confirmation: Require explicit user approval before executing a tool
- User Input: Gather specific information from users during execution
- Dynamic User Input: Have the agent collect user input as it needs it
- External Tool Execution: Execute tools outside of the agent’s control
Currently Agno only supports Human-in flows for
Agent. Team and Workflow will be supported in the near future!Resolving Human-in-the-Loop Requirements
During Human-in-the-Loop flows, the agent run will pause to wait for the user to resolve whatever requirement is needed. This is how you can interact with the requirements in your code:Types of Human-in-the-Loop Requirements
There are three types of Human-in-the-Loop requirements you can handle in your code: User confirmation, user input and external tool execution. This is how you can check the type of a requirement in your code:Resuming Agent Execution
After all active requirements have been resolved, you will want to continue the run. You do this by calling thecontinue_run method:
This is how the full flow would look like in your code:
continue_run method continues with the state of the agent at the time of the pause.
You can also call the continue_run method passing the RunOutput of the specific run to continue:
Streaming Human-in-the-Loop Flows
You can also stream the responses you get during a Human-in-the-Loop flow. This is useful when you want to process or show the response in real-time. It works similarly to non-streaming. You will just need to handle the events you get from streaming the Agent run. If any event is paused, then you will need to handle the active requirements:You can also stream the events resulting from calling the
continue_run or acontinue_run methods.Learn More
User Confirmation
Require explicit user approval before executing tool calls
User Input
Gather specific information from users during execution
Dynamic User Input
Let agents request user input dynamically when needed
External Tool Execution
Execute tools outside of the agent’s control