Command
objects from your agent nodes or tools:
Command
primitive allows specifying a state update and a node transition as a single operation, making it useful for implementing handoffs.Command
, you can either use prebuilt create_react_agent
/ ToolNode
components, or implement your own tool-executing node that collects Command
objects returned by the tools and returns a list of them, e.g.:Send()
primitive to directly send data to the worker agents during the handoff. For example, you can request that the calling agent populate a task description for the next agent:
Send()
in handoffs.
ToolNode
, as they natively support handoffs tools returning Command
. Below is an example of how you can implement a multi-agent system for booking travel using handoffs:
Full example: Multi-agent system for booking travel
Command
primitive allows specifying a state update and a node transition as a single operation, making it useful for implementing handoffs.
interrupt
to collect user input and routes back to the active agent.
The agents can then be implemented as nodes in a graph that executes agent steps and determines the next action:
Full example: multi-agent system for travel recommendations
langgraph-supervisor
library to create a supervisor multi-agent systems.langgraph-swarm
library to create a swarm multi-agent systems.