Human in the loop
Human-machine collaboration (or "human-in-the-loop") enhances agent functionality through several common user interaction patterns:
- Approval: Actions requiring user confirmation, interrupting before invoking the node.
- Editing: Actions requiring user input, interrupting before invoking the tool.
Configuring Sensitive Agents and Toolsโ
By designating sub-agents or tools as sensitive, the primary agent will be interrupted before invoking these sensitive nodes. At this point, the system presents a confirmation and parameter editing window, allowing users to review and modify the parameters about to be used. The primary agent will proceed with the invocation only after the user confirms and approves. This mechanism ensures user involvement and control at critical nodes, enhancing the system's safety and flexibility.
After users review or edit the parameter values, the agent will proceed with invoking the sub-agent or tool using the updated parameters.
Implementation Principlesโ
The interruption of sensitive nodes in human-machine collaboration is implemented through the Breakpoints feature in langgraph.js. Breakpoints allow the setting of pause points at specific nodes. When the agent reaches these nodes, the system halts execution and triggers the user interaction interface. This mechanism ensures user participation at critical points, enabling users to review, edit, or confirm parameters during execution.