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.
|
Thanks for raising this, @Kaap10 I think the key architectural point is not “must live in dynaflow vs dynavec,” but “must remain decoupled from concrete retrieval/memory implementations.” I agree with the intent of separating orchestration from retrieval. The supervisor, handoff, and workflow state are runtime/workflow concerns, and they should not directly depend on dynavec-specific retrieval internals like vector search, BM25, or embeddings. At the same time, I don’t think it is inherently wrong to introduce these as generic primitives in the current package as long as they are: interface-driven dynavec provides memory/retrieval capabilities That’s the distinction I’d like us to preserve here. cc- @codeforstartups |
|
Hi @tikhandesanket, thanks for following up. To be completely clear: the review feedback was not about coupling to retrieval or memory backends. We fully agree that orchestration should remain decoupled from storage and retrieval. The concern is strictly about the actual code implementation in this PR and the contract defined in #289:
We want to keep PRs focused and decoupled, but we cannot merge placeholder stubs that don't perform the responsibilities they advertise. Let's either:
|
|
@Kaap10 Thanks for the clarification. I understand the issues now. The current Supervisor runs all agents instead of selecting the right one, Handoff doesn't properly transfer control, and ReActAgent.run() doesn't use the state parameter. I'll review the existing AgentGraph design and state handling before making changes. I'll align the implementation with #289, add tests for agent selection, handoff, and state preservation, and ensure the solution fits the agreed architecture without duplicating existing functionality. |
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