Description
Decouple the routing logic (which agent should handle which action item) from the dispatch execution (actually sending requests to agents). This separation improves maintainability, testing, and enables advanced routing strategies.
Current Architecture
The AgentDispatchOrchestrator currently combines routing and dispatch:
# Current: Routing and dispatch are tightly coupled
@step
async def dispatch_to_agents(self, ctx: Context, ev: StartEvent):
for action_item in ev.action_items:
# Routing logic embedded here
if "jira" in action_item.category.lower():
agent = agents["jira-agent"]
elif "meeting" in action_item.description.lower():
agent = agents["google-agent"]
# Dispatch logic also here
result = await self._execute_agent(agent, action_item)
Proposed Architecture
- Separate Router Module
- Enhanced LLM Capability Based Routing
- Separated Dispatcher
- Updated Orchestrator
- User Can See Routing Decision In Review Phase
Benefits
1. Testability
- Test routing logic independently
- Test dispatch logic independently
- Mock components easily
2. Observability
- Track routing decisions separately
- Monitor routing confidence scores
- Analyze routing accuracy
3. Advanced Features
- Fallback routing to alternative agents
- Multi-agent routing (for complex tasks)
Acceptance Criteria
Priority: 🟡 Medium
Effort: 8-10 hours
Difficulty: Medium
Description
Decouple the routing logic (which agent should handle which action item) from the dispatch execution (actually sending requests to agents). This separation improves maintainability, testing, and enables advanced routing strategies.
Current Architecture
The
AgentDispatchOrchestratorcurrently combines routing and dispatch:Proposed Architecture
Benefits
1. Testability
2. Observability
3. Advanced Features
Acceptance Criteria
AgentRoutermodule createdAgentDispatchermodule createdPriority: 🟡 Medium
Effort: 8-10 hours
Difficulty: Medium