https://retellai.com/?utm_source=discord&utm_medium=seo logo
I am trying to use the agent_transfer tool
# ❓・ai-evy-support
j
@AI Evy I am trying to use the agent_transfer tool. My set up is Agent #1 is a demo of a appointment setting agent that answer questions about the fake store and set's up an appointment. Once that happens, we tell the user that the demo is complete and will transfer them to Agent #2 to discuss next steps. However Agent #2 keeps asking about the appointment set during the demo, but since that is fake, it can be confusing. Is there a way for Agent #2 to not discus information from Agent #1?
a
Thanks for tagging me @jdinkelmann. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, this behavior is actually by design with Agent Transfer. The destination agent (Agent #2) has access to the full conversation history from Agent #1 [(1) ]() [(2) ]() . This is specifically mentioned as one of the advantages of Agent Transfer: "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" . However, you can control this behavior through Agent #2's prompt configuration. To prevent Agent #2 from discussing the demo appointment information, you should: 1. Update Agent #2's prompt to explicitly instruct it to ignore or acknowledge that any previous appointment discussion was part of a demo and should not be referenced for real business purposes. 2. Configure the prompt to focus Agent #2 on discussing next steps rather than reviewing previous conversation details. 3. Use clear instructions in Agent #2's prompt such as: "Do not reference or discuss any appointment details from the previous conversation as they were part of a demo scenario." The sources don't provide a way to selectively hide conversation history from the transferred agent, as this full history access is a core feature of Agent Transfer . The solution is to handle this through proper prompt engineering in Agent #2.
​ To learn more, see the sources I considered: [[1] Agent Transfer](https://docs.retellai.com/build/single-multi-prompt/transfer-agent) [[2] Agent Transfer Node](https://docs.retellai.com/build/conversation-flow/transfer-agent-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
ok, makes sense. one more question. Do dynamic variables pass between the agents too? do I need to set up anything to make that happen?
@AI Evy ^
a
Thanks for the follow-up, @jdinkelmann. I'll get back to you soon.
### Answer Based on the sources, dynamic variables do pass between agents during Agent Transfer, but there are specific settings that control this behavior [(1) ]() [(2) ]() . For Agent Transfer configuration, you can control dynamic variable handling through the Post call analysis setting . This setting allows you to choose whether to: - Extract dynamic variables for only the transferred agent - Extract dynamic variables for both agents The sources indicate that when using Agent Transfer, the Transfer Settings Behavior specifies that certain settings from the first agent are used throughout the call, while other settings reflect the currently active agent . However, the sources don't explicitly detail whether dynamic variables are automatically passed between agents or require specific configuration. For dynamic variables in general, they can be set at the agent level as defaults and can be passed through various methods like the
retell_llm_dynamic_variables
field in API calls [(3) ]() [(4) ]() . To ensure dynamic variables work properly between your agents, you'll want to configure the Post call analysis setting when setting up your Agent Transfer to specify how dynamic variables should be handled between Agent #1 and Agent #2 [(1) ]() [(2) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.