Router Guide
Router Review We built a graph that uses messages as state and a chat model with bound tools. We saw that the graph can: * Return a tool call * Return a natural language response Goals We can think of this as a router, where the chat model routes between a direct response or a tool call based upon the user input. This is a simple example of an agent, where the LLM is directing the control flow either by calling a tool or just responding directly. Let's extend our graph to work with either output! For this, we can use two ideas: (1) Add a node that will call our tool. (2) Add a conditional edge that will look at the chat model output, and route to our tool calling node or simply end if no tool call is performed.
When to use Router
Router Review We built a graph that uses messages as state and a chat model with bound tools. We saw that the graph can: * Return a tool call * Return a natural language response Goals We can think of this as a router, where the chat model routes between a direct response or a tool call based upon the user input. This is a simple example of an agent, where the LLM is directing the control flow either by calling a tool or just responding directly. Let's extend our graph to work with either output! For this, we can use two ideas: (1) Add a node that will call our tool. (2) Add a conditional edge that will look at the chat model output, and route to our tool calling node or simply end if no tool call is performed.
How to use Router
Router is a single agent agent built on the LangGraph framework. Set it up from the source repository, configure your model credentials, and invoke it for tasks that match its description. Review the safety profile below before running it against production data or systems.
Safety profile
Autonomy
Semi-autonomous
Sandbox-aware
No declared sandbox guidance
Network access
Unspecified
Filesystem access
Unspecified