How to Route to Multiple Agents
Validated on 26 Jun 2025 • Last edited on 8 Jul 2025
GradientAI Platform lets you build fully-managed AI agents with knowledge bases for retrieval-augmented generation, multi-agent routing, guardrails, and more, or use serverless inference to make direct requests to popular foundation models.
Agent routing is the ability to reference other agents from the instruction of an agent. Different agents may be trained or optimized for specific tasks or have different domain expertise to handle different types of requests. Agent routing lets you unify multiple agents.
For example, you can have a parent travel agent that comprises of four independent child agents that work in conjunction. The top level general foundation model handles the pleasantries and routes user requests to the more specific trip planner, site help agent, and booking agent models. Suppose these agents are called Trip Planner
, Site Help
, Flight Booking
, and Hotel Booking
, respectively. The foundation models of each agent can be of different kind, meaning that the chat bot can integrate with other kinds of generative models such as a diffusion model to generate pictures.
We charge for tokens used by parent agents to determine whether the user questions need to be routed to a child agent and agents that answer user questions, which can be a parent agent or a child agent to which the question gets routed.
Add an Agent Route Using Automation
To add an agent route using the DigitalOcean API, you need the unique identifiers of the parent agent and one or more child agents that the parent agent routes to. To get a list of agents with their unique identifiers, use the /v2/gen-ai/agents}
endpoint.
You also need to provide a name of the agent route and rules that to determine how to direct different inputs to the appropriate child agent. To view agent routes for the parent agent, use the /v2/gen-ai/agents/{uuid}/child_agents
endpoint.
Add an Agent Route Using the Control Panel
To add agent routes to an agent from the control panel, click Agent Platform from the left menu and then click on the agent you want to add the agent route to. In the Resources tab, scroll to the Agent Routes section and click Add Agent Route. In the Add Agent Route window, specify the following information:
-
Route name: Name of the agent route. For example,
travel agent routes
. -
Route instructions: These instructions map your input types or attributes to the right agent which has the expertise for that input attribute. Create a set of rules that determine how different inputs are directed to the appropriate agent.
Click Save to save the agent route. The agent route is displayed in the AGENT ROUTES table in the Resources tab.