Skip to navigation

Agent routing

Hand a caller to another agent on the same call
View as Markdown

Agent routing lets an agent pass the live caller to another agent of your team. The caller hears a short hold line, and the next agent takes over the same call with its own prompt, tools, knowledge base, voice and languages. It isn’t a phone transfer: there is no new call, number or ring.

Use it to:

  • Split one large agent into focused ones. A front desk works out what the caller wants and routes them to the agent for that job (complaints, billing, warranty). Each agent’s prompt then holds only its own job, which keeps it short, fast and consistent.
  • Keep prompts within their limit. If a prompt is too long because it covers several jobs or several languages, give each one its own agent instead of raising the limit.
  • Serve callers in their own language. Each agent keeps its own languages, voice and speech recognition. A front desk can ask the caller’s preferred language and route them to the agent for it, with that language’s script and questions. This also keeps each agent within the recommended 3 languages.

If you already know which language or job a call needs before you place it, you don’t need routing: place the call with that agent directly (one agent per language, for example).

Set it up

  1. Create the agents the calls should go to, in the same team.
  2. Open the first agent’s settings and go to the Advanced tab. Under Agent routing, select Add agent and pick an agent.
  3. In When to route, write one line saying when the call should go there, for example “Caller reports a fault or wants to file a complaint”.
  4. Repeat for each agent this one may hand callers to, then save.

Raya tells the agent when to use each route, so its prompt doesn’t need to mention routing. Each agent has its own list: to let a specialist send the caller back or on, add routes to that agent too.

If the section says the agent’s LLM can’t route calls, pick an LLM option that supports tools. Agents on such an option are the only ones that can route or be routed to.

Write the prompts

  • Keep each prompt about its own job. Don’t name the other agents in it.
  • Write each “When to route” line as what the caller wants, and keep the lines from overlapping. Name concrete requests; a list of topics (“prices, billing, warranty”) works better than “anything that is not a complaint”.
  • Route early. Tell the first agent to route as soon as the request is clear and not to collect details the next agent will ask for.
  • Write the receiving agent’s flow to start mid-call. An agent that receives a routed call skips its welcome: it reads the handoff note and the caller’s last sentence and answers them.
  • Make the handoff note complete. It’s all the next agent knows about the call so far, so tell the first agent to put in the caller’s name, any numbers and everything collected.
  • Give specialists a way out, not refusal rules. A line like “You do not handle prices” makes the agent refuse instead of routing. Give it a route back (or straight to the agent callers often need next) and write “Anything outside complaints is not yours to answer; never refuse it.”

What carries over

Comes from
Prompt, tools, knowledge base, voice, languages, LLM, turn-taking settingsThe agent currently on the call
Noise filter (denoiser) and maximum call durationThe agent that answered the call
Output fields, webhook and contact memoryThe agent the call ended on, over the whole transcript

Limits

  • Up to 10 agents in one agent’s routing list.
  • Up to 5 switches per call. After the fifth, the agent has to help the caller itself or end the call, so its prompt shouldn’t promise to connect the caller to anyone else.
  • All agents must be in the same team and on an LLM option that supports tools.

Calls, transcripts and billing

  • A routed call is one call, listed under the agent that answered it. Its transcript shows a “Routed to <agent>” line where each switch happened.
  • If the agents use different LLM, voice or speech options, each part of the call is charged at the rate of the agent on the line during that part.

Test it

Test each agent on its own first, then the whole flow from the first agent. Simulations through Raya’s MCP server follow routes too: the reply after a switch is the next agent’s first line.