Comment by peab

Comment by peab 10 hours ago

9 replies

I think the term sub-agent is almost entirely useless. An agent is an LLM loop that has reasoning and access to tools.

A "sub agent" is just a tool. It's implantation should be abstracted away from the main agent loop. Whether the tool call is deterministic, has human input, etc, is meaningless outside of the main tool contract (i.e Params in Params out, SLA, etc)

nostrebored 3 hours ago

Nah, when working on anything sufficiently complicated you will have many parallel subagents that need their own context window, ability to mutate shared state, sandboxing differences, durability considerations, etc.

If you want to rewrite the behavior per instance you totally can, but there is a definite concept here that is different than “get_weather”.

I think that existing tools don’t work very well here or leave much of this as an exercise for the user. We have tasks that can take a few days to finish (just a huge volume of data and many non deterministic paths). Most people are doing way too much or way too little. Having subagents with traits that can be vended at runtime feels really nice.

moinism 9 hours ago

I agree, technically, "sub agent" is also another tool. But I think it's important to differentiate tools with deterministic input/output from those with reasoning ability. A simple 'Tool' will take the input and try to execute, but the 'subagent' might reason that the action is unnecessary and that the required output already exists in the shared context. Or it can ask a clarifying question from the main agent before using its tools.

the_mitsuhiko 6 hours ago

> It's implantation should be abstracted away from the main agent loop. Whether the tool call is deterministic, has human input, etc, is meaningless outside of the main tool contract (i.e Params in Params out, SLA, etc)

Up to a point. You're obviously right in principle, but if that task itself has the ability to call into "adjacent" tools then the behavior changes quite a bit. You can see this a bit with how the Oracle in Amp surfaces itself to the user. The oracle as sub-agent has access to the same tools as the main agent, and the state changes (rare!) that it performs are visible to itself as well as the main agent. The tools that it invokes are displayed similarly to the main agent loop, but they are visualized as calls within the tool.

verdverm 8 hours ago

ADK differentiates between tools and subagents based on the ability to escalate or transfer control (subagents), where as tools are more basic

I think this is a meaningful distinction, because it impacts control flow, regardless what they are called. The lexicon are quite varied vendor-to-vendor

  • peab 7 hours ago

    Are there any examples of implementations of this that actually work, and/or are useful? I've seen people write about this, but I haven't seen it anywhere

    • verdverm 7 hours ago

      I think in ADK, the most likely place to find them actually used is the Workflow agent interfaces (sequential, parallel, loop). Perhaps looping, where it looks like they suggest you have an agent that determines if the loop is done and escalates with that message to the Looper.

      https://google.github.io/adk-docs/agents/workflow-agents/

      I haven't gotten there yet, still building out the basics like showing diffs instead of blind writing and supporting rewind in a session

Vinnl 8 hours ago

What does "has reasoning" mean? Isn't that just a system prompt that says something like "make a plan" and includes that in the loop?

  • peab 7 hours ago

    You actually probably don't need reasoning, as the old non reasoning models like 4o can do this too.

    In the past, the agent type flows would work better if you prompted the LLM to write down a plan, or reasoning steps on how to accomplish the task with the available tools. These days, the new models are trained to do this without promoting

ColinEberhardt 10 hours ago

Oh, so _that_ is what a sub-agent is. I have been wondering about that for a while now!