Repository navigation
feat(agents): add multi-agent supervisor primitives - #343
tikhandesanket wants to merge 2 commits into
Conversation
Kaap10
left a comment
There was a problem hiding this comment.
Thanks for working on this @tikhandesanket. While the goal of introducing multi-agent primitives from #289 is great, the current implementation consists of placeholder abstractions that don't yet fulfill the requirements of the issue:
-
Supervisordoes not route requests:
Insrc/dynavec/agents/supervisor.py,Supervisor.run()runs every agent sequentially in a list comprehension ([agent.run(goal, state=state) for agent in self.agents]). A supervisor needs routing logic (e.g., using an LLM or router prompt) to determine which named specialist agent to delegate to based on the user's request, rather than executing all agents for every query. -
Handoffis an identity function:
Insrc/dynavec/agents/handoff.py,Handoff.__call__is currentlyreturn state. A handoff mechanism should actively transfer execution control and conversation/context between agents (e.g., as a callable tool or graph transition). -
ReActAgentdoes not usestateand breaks async parity:
Insrc/dynavec/agents/react.py,state: AgentState | None = Nonewas added torun(), but it is never read, modified, or incorporated into messages/prompts. Additionally,arun()was not updated to acceptstate, breaking parity between sync and async execution. -
Missing scope from #289:
The issue requires routing to named agents, control + context handoffs, and sub-agents runnable as nodes/sub-graphs.
Please revisit the architecture so that the supervisor performs actual task routing and handoffs transfer execution control. We can't merge placeholder primitives into the public API.
Description
This PR implements the multi-agent supervisor pattern proposed in #289.
The supervisor acts as a central orchestrator that receives a user request, determines which specialist agent should handle it, and routes the request accordingly.
The implementation focuses on keeping the agents decoupled, with the supervisor responsible for coordination rather than embedding specialist-specific logic into individual agents.
Related issue
Fixes #289
Changes
Testing
Checklist