{ "cells": [ { "cell_type": "markdown", "id": "7388763d", "metadata": {}, "source": [ "# Human-in-the-loop\n", "\n", "When creating LangGraph agents, it is often nice to add a human in the loop\n", "component. This can be helpful when giving them access to tools. Often in these\n", "situations you may want to manually approve an action before taking.\n", "\n", "This can be in several ways, but the primary supported way is to add an\n", "\"interrupt\" before a node is executed. This interrupts execution at that node.\n", "You can then resume from that spot to continue.\n", "\n", "
Note
\n", "\n",
" In this how-to, we will create our agent from scratch to be transparent (but verbose). You can accomplish similar functionality using either `interruptBefore` or `interruptAfter` in the createReactAgent(model, tools=tool, interruptBefore=[\"tools\" | \"agent\"], interruptAfter=[\"tools\" | \"agent\"])
API doc constructor. This may be more appropriate if you are used to LangChain's AgentExecutor class.\n",
"