Team calling 2 agents (RAG and custom function), the RAG agent doesn't use the exact instructions

Hi Support Team

I have a team agent that call two agents (RAG and custom tool). The problem I am facing is that when the team agent transfer the call to the RAG agent, then the RAG agent does using the instructions given fully.

This is the prompt of my RAG agent:
generalQuestions_agent_prompt = “”"
“You only answer with information from your RAG database.
You don’t use your internal knowledge.
If the customer has a problem with a previous service rendered always empatheticly ask them to contact the dedicated phone number 27113128472. to resolve your issue promtply.
Summarise the answer in about 2 sentences.
If you can’t answer with the database, simple return ‘I don’t know’.
At the end of each response add the phrase ‘Type * for Main Menu’ in italic text”
“”"

What I am noticing is that when I call the RAG agent directly it adheres to the instruction given, in particular the part that says: “At the end of each response add the phrase ‘Type * for Main Menu’ in italic text”. Meaning it does add the phrase at the end of the response

However when I call the team agent, the team agent successfully transfer to the RAG agent but doesn’t adhere to the part At the end of each response add the phrase ‘Type * for Main Menu’ in italic text". Meaning that it doesn’t add the phrase at the end of the response:

Here is a snippet of my code:
generalQuestions_agent_prompt = “”"
“You only answer with information from your RAG database.
You don’t use your internal knowledge.
If the customer has a problem with a previous service rendered always empatheticly ask them to contact the dedicated phone number 27113128472. to resolve your issue promtply.
Summarise the answer in about 2 sentences.
If you can’t answer with the database, simple return ‘I don’t know’.
At the end of each response add the phrase ‘Type * for Main Menu’ in italic text”
“”"

generalQuestions_agent = Agent(
name=“General Questions Agent”,
model=Gemini(id=“gemini-2.0-flash-exp”),
role=“Answer questions from the knowledgebase”,
session_id=userMobileNumber,
# Add the knowledge base to the agent
knowledge=knowledge_base,
show_tool_calls=False,
markdown=True,
search_knowledge=True,
add_datetime_to_instructions=True,
# Set add_history_to_messages=true to add the previous chat history to the messages sent to the Model.
add_history_to_messages=True,
# Number of historical responses/messages to add to the messages.
num_history_responses=5,
# Store agent sessions in a database
storage=SqliteAgentStorage(table_name=“agent_knowledgebase_updated”, db_file=“tmp/agent_storage.db”),
description=[“You are a customer service representative for a surface cleaning company called, SurfaceCure Pressure Cleaning”],
instructions=[generalQuestions_agent_prompt]
)

quotation_agent = Agent(
name=“Quotation Agent”,
model=Gemini(id=“gemini-2.0-flash-exp”),
session_id=userMobileNumber,
tools=[sendQuoteConfirmation],
show_tool_calls=True,
markdown=True,
instructions=[
“Only use the sendQuoteConfirmation tool.”,
“Use the Quotation Agent if the customer ask for a quotation/quote or the price for a service.”,
“Under no circumstances should you ask for additional information.”
]
)

team_agent = Agent(
name=“Agent Team”,
model=Gemini(id=“gemini-2.0-flash-exp”),
session_id=userMobileNumber,
team=[generalQuestions_agent, quotation_agent],
show_tool_calls=True,
markdown=True,
instructions=[
“First, use the General Questions Agent”,
“If the customer request a quotation or a quote or the price for a cleaning service then use the Quotation Agent”,
“If the customer say give me a quotation or a quote or the price for a cleaning service then use the Quotation Agent”
],
add_datetime_to_instructions=True,
# Set add_history_to_messages=true to add the previous chat history to the messages sent to the Model.
add_history_to_messages=True,
# Number of historical responses/messages to add to the messages.
num_history_responses=10,
# Store agent sessions in a database
#storage=SqliteAgentStorage(table_name=“agent_teamagent”, db_file=“tmp/agent_storage.db”),
)

team_agent.print_response(“What is the name of the company?”)
team_agent.cli_app(stream=True)

Hi @edisonpearce
Thanks for reaching out and for using Agno! I’ve looped in the right engineers to help with your question. We usually respond within 48 hours, but if this is urgent, just let us know, and we’ll do our best to prioritize it.
Appreciate your patience—we’ll get back to you soon! :smile:

Hi @edisonpearce
This comes down to prompt design I think. So the leader agent transfers the task to the member agents by re-interpreting it and saying in its own words.

We also just released a new version of teams. I think the route mode would suite your use-case a lot better! Route Mode - Agno

Hi Dirk

Thank you for your prompt response and your answer is perfectly correct for me :slight_smile: