Hello!
I have a question about the "3.3.4. Interact with the Agent Team"
When I look at the call stack I can see we never return to the “root agent”. At the end of the first step, we are inside “greeting_subagent_v1” and its delegate to “farewell_subagent_v1” when we send the second message “Thanks bye” by using the internal Google ADK tool “transfer_to_agent”.
I understand each agent have access to ALL agents description, so “greeting_subagent_v1” knows he could delegate to “farewell_subagent_v1” but the decision criteria is unclear for me. The “root agent” have the instruction to delegate either to “greeting_subagent_v1” or “farewell_subagent_v1” depending on the task. But the “greeting_subagent_v1” do not have this instruction. So can he decides to delegate? If it based only on the “description” of other agent et his description, it could works here because it is simple enough.
We should always return to the root agent so HE decides to which agents delegate no? It seems to me it is a bettern pattern. And I don’t really get how the pattern offers in the lesson could world in a more complex environnements.
Am I right ? Is there something I am missing?
>>> User Query: Hello I'm ABK
[Event] Author: friendly_agent_team_v1, Type: Event, Final: False, Content: parts=[Part(
function_call=FunctionCall(
args={
'agent_name': 'greeting_subagent_v1'
},
id='call_d07q8VQroo00DRFvnchUm9OT',
name='transfer_to_agent'
)
)] role='model'
[Event] Author: friendly_agent_team_v1, Type: Event, Final: False, Content: parts=[Part(
function_response=FunctionResponse(
id='call_d07q8VQroo00DRFvnchUm9OT',
name='transfer_to_agent',
response={
'result': None
}
)
)] role='user'
[Event] Author: greeting_subagent_v1, Type: Event, Final: False, Content: parts=[Part(
function_call=FunctionCall(
args={
'person_name': 'ABK'
},
id='call_EUNCz49nh8SiGId3Vc2GAsI7',
name='say_hello'
)
)] role='model'
[Event] Author: greeting_subagent_v1, Type: Event, Final: False, Content: parts=[Part(
function_response=FunctionResponse(
id='call_EUNCz49nh8SiGId3Vc2GAsI7',
name='say_hello',
response={
'query_result': [
{
'reply': 'Hello to you, ABK'
},
],
'status': 'success'
}
)
)] role='user'
[Event] Author: greeting_subagent_v1, Type: Event, Final: True, Content: parts=[Part(
text='Hello to you, ABK!'
)] role='model'
<<< Agent Response: Hello to you, ABK!
>>> User Query: Thanks, bye!
[Event] Author: greeting_subagent_v1, Type: Event, Final: False, Content: parts=[Part(
function_call=FunctionCall(
args={
'agent_name': 'farewell_subagent_v1'
},
id='call_NPMikzDH2c33WCQdMiQZaq5l',
name='transfer_to_agent'
)
)] role='model'
[Event] Author: greeting_subagent_v1, Type: Event, Final: False, Content: parts=[Part(
function_response=FunctionResponse(
id='call_NPMikzDH2c33WCQdMiQZaq5l',
name='transfer_to_agent',
response={
'result': None
}
)
)] role='user'
[Event] Author: farewell_subagent_v1, Type: Event, Final: False, Content: parts=[Part(
function_call=FunctionCall(
args={},
id='call_xv95pUtdkYwFlPJ5ArilbOsc',
name='say_goodbye'
)
)] role='model'
[Event] Author: farewell_subagent_v1, Type: Event, Final: False, Content: parts=[Part(
function_response=FunctionResponse(
id='call_xv95pUtdkYwFlPJ5ArilbOsc',
name='say_goodbye',
response={
'query_result': [
{
'farewell': 'Goodbye from Cypher!'
},
],
'status': 'success'
}
)
)] role='user'
[Event] Author: farewell_subagent_v1, Type: Event, Final: True, Content: parts=[Part(
text='Goodbye from Cypher!'
)] role='model'
<<< Agent Response: Goodbye from Cypher!