Sub-Agent Delegation question: IIUC, the agent dec...
# proj-sdk
e
Sub-Agent Delegation question: IIUC, the agent decides which sub-agents get spawned based on the initial prompt? For example, looking at examples/01_standalone_sdk/25_agent_delegation.py, I'm assuming the
DelegateTool
will automatically create the unique sub-agent IDs (e.g.,
lodging
and
activities
in the example) for the sub-agents it decides to spawn?
s
Yes the delegator creates meaningful sub-agent names at runtime given the context. And then it uses those names to send follow-up messages. (meaningful names seems more appropriate than random ids: easier for main agent to remember + better logs)
e
OK, cool - makes sense. This confirms how I interpreted the example code. I'm curious if there's a use case for declaring (as code) specific sub-agents the main agent should spawn?
s
You can prompt the main agent for specific names if needed? But names are just names, it has nothing to do with specific skills or tools
c
@elegant-branch-54423 I have a todo to show exactly that--creating a pool of agents for the delegator where specific tools and prompts for subagent are set ahead.
s
Oh so you mean: we pre-define agent configurations and the delegator can load sub-agents from this set of agents? The same way that agents can call pre-defined tools ?
c
Yes. Basically create a pool and pass in to Delegator tool.
e
Simon - yes, more of that use case. E.g., a way to guarantee that a certain sub-agent is always spawned
s
OK. Right now in the code there is no "certain sub-agent" yet. This requires adding a layer for defining specific agents and registering them
c
I think we had a conversation in slack about this last week or week before. You had proposed AgentSpec I think and Robert had an idea about it too.
s
Yes! but it wasn't made into an issue or prioritized. Let me try to find that convo
c
There was less content there than I remembered but perhaps we should restate for this public thread.
Mostly discussion centered on whether we pass strings or objects to the DelegatorTool to configure subagents w/ tools... but mentioned in passing. What do you think we ought to do @strong-ice-84145?
s
Let me create an issue to come up with a nice design for adding available sub-agents to the delegator. Perhaps something close to how we add tools to agents.
ty 1
FYI a PR that allows specific sub-agents https://github.com/OpenHands/software-agent-sdk/pull/1223
🙌 1
c
ooo super excited to try this!