Skip to content

Use of PlanReActPlanner with sub-agents #3927

Description

Hi all,
I'm trying to implement PlanReActPlanner with ADK 1.21.0, but I'm having some issues.

My architecture would be the following:

  • root_agent with PlanReActPlanner
  • subagent_a
  • subagent_b

Now, I want to connect subagent_a and subagent_b to router_agent via sub_agents, not tools, because with the latter I have less traceability of what the sub_agents actually do (e.g. they use multiple tools).

I also want the router_agent to think iteratively, always evaluating the sub agents replies and act. E.g. the plan first say to call A, then the result of A is not satisfying (e.g. no documents found in internal documentation) then I use B as a fallback.

How should this be implemented? My feeling is that PlanReActPlanner:

  1. is not iterating: it makes one plan and just executes without revising it, or adding actions
  2. only works with agents as a tool, not with sub agents. Indeed my sub agents just reply to the user and cannot go back to the router. I tried to force the comeback with:
function_call = FunctionCall(
    args={"agent_name": "root_agent"},
    name="transfer_to_agent",
)
new_part = Part(function_call=function_call)
llm_response.content.parts.append(new_part)

But I get "tool not found" error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    core[Component] This issue is related to the core interface and implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions