> ## Documentation Index
> Fetch the complete documentation index at: https://docs.retellai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Transfer

> Agent Transfer (agent swap) lets a Retell single or multi-prompt agent hand the conversation to another AI agent — for specialized tasks or language switches.

In advanced call flows, it's common to switch the handling agent, transferring the conversation from one AI agent to another. **Agent Transfer** (also known as **Agent Swap**) enables you to modularize tasks and re-use specialized agents without relying on [traditional phone-based transfers](/build/single-multi-prompt/transfer-call). Examples include:

* Transferring from a front-desk agent to an appointment-booking agent based on task.
* Transferring from an agent speaking one language to another agent handling a different language, based on user preference.

## Why Use Agent Transfer Instead of Call Transfer?

Compared to transferring to another agent using [transfer call](/build/single-multi-prompt/transfer-call), **Agent Transfer** offers significant advantages:

* **Lower Latency**: The transition between agents is near-instant, much lower than transfer call.
* **Better Reliability**: No need to create a new phone call, avoiding potential telephony failures.
* **No Handoff Message Needed**: The destination agent has access to the full conversation history, eliminating the need for adding hand-off messages or repeated customer questions.
* **No Separate Numbers for Agents**: Agents receiving transfers don’t need their own phone numbers — one number is all you need, no matter how many agents you transfer to.

## Transfer Settings Behavior

The following settings of the first agent will be used throughout the call:

* optInSignedUrl
* optOutSensitiveDataStorage
* webHookUrl

All other settings — such as language, voice, and voiceModel — will reflect the currently active agent.

## What context the destination agent receives

When the conversation is handed off via Agent Transfer, the destination agent automatically inherits:

* **Full conversation history** — the transcript of the call up to the transfer point, so the new agent has the same context the previous agent did and the caller does not need to repeat information.
* **Call-level `metadata`** — set on the original call (for example, via [Create Phone Call](/api-references/create-phone-call) or the [Inbound Call Webhook](/features/inbound-call-webhook)) and shared across all agents on the same call.
* **Dynamic variables** — both the `retell_llm_dynamic_variables` provided when the call started and any variables extracted earlier in the call (see [Extract dynamic variables](/build/single-multi-prompt/extract-dv)) remain available to the destination agent's prompt.

There is no separate "pass variables" parameter on the Agent Transfer tool — the mechanism is the shared call context above. If you need the destination agent to act on a specific value, extract it into a dynamic variable on the source agent and reference that variable in the destination agent's prompt.

## Steps

<Steps>
  <Step title="Add Agent Transfer Tool">
    Click Add in the tools section and select "Agent Transfer" from the dropdown menu.

    <Frame>
      <img height="700" src="https://mintcdn.com/retellai/M9QYKZE4hbt00HfL/images/multi-prompt/transfer_agent.png?fit=max&auto=format&n=M9QYKZE4hbt00HfL&q=85&s=93cc0e90a6ef55b5d919bd04368a1fb1" data-path="images/multi-prompt/transfer_agent.png" />
    </Frame>
  </Step>

  <Step title="Configure Details">
    You can configure the following main settings:

    * **Transfer agent**: the ID and version of a specific agent to transfer to. You can select the latest version as well.
    * **Speak during execution and messages**: if the agent should speak something while performing the transfer.
    * **Post call analysis setting**: choose which agent's post-call analysis applies after the transfer. Select **Only transferred agent** to run post-call analysis with the destination agent's full analysis configuration — its analysis fields, analysis model, and analysis prompts — or **Both this agent and transferred agent** to keep the analysis fields from both agents.

    <Frame>
      <img height="700" src="https://mintcdn.com/retellai/M9QYKZE4hbt00HfL/images/multi-prompt/transfer_agent_detail.png?fit=max&auto=format&n=M9QYKZE4hbt00HfL&q=85&s=2dbaafc521eb828d82ba37c75eb6881b" data-path="images/multi-prompt/transfer_agent_detail.png" />
    </Frame>
  </Step>

  <Step title="Update the Prompt to Enable Agent Transfer">
    Ensure the AI agent knows when and why to trigger the agent transfer. Add clear instructions in the prompt such as:

    * `"If the user asks to book an appointment, use the agent_transfer tool to transfer to the Appointment Agent."`

    <Frame>
      <img height="700" src="https://mintcdn.com/retellai/M9QYKZE4hbt00HfL/images/multi-prompt/agent_transfer_prompt.png?fit=max&auto=format&n=M9QYKZE4hbt00HfL&q=85&s=3b2f7d8e892240fbc46ca0fbe0096ad5" data-path="images/multi-prompt/agent_transfer_prompt.png" />
    </Frame>
  </Step>

  <Step title="Test and Debug">
    You can test agent transfer both in web call and playground.

    <Frame>
      <img height="700" src="https://mintcdn.com/retellai/M9QYKZE4hbt00HfL/images/multi-prompt/playground_test.png?fit=max&auto=format&n=M9QYKZE4hbt00HfL&q=85&s=c349f16a44ce7c1f69b0d58a711c7e3e" data-path="images/multi-prompt/playground_test.png" />
    </Frame>
  </Step>
</Steps>
