Zum Inhalt springen
>_<
AI EngineeringWiki

Task Delegation Pattern

Patterns · 5 min

The Problem

A single agent can't do everything better than specialized tools. You need a system that selects the right agent for the right task.

Architecture

User Request
     |
     v
[Orchestrator Agent]
     |
     +---> [Research Agent] ----> Web Search, Docs
     |
     +---> [Coder Agent] ----> Code Generation
     |
     +---> [Review Agent] ----> PR Review, Tests
     |
     v
  Final Response

Implementation

1. Intent Classification

The Orchestrator classifies the user request and routes it to the appropriate agent.

2. Routing Matrix

const routes = {
  'code-generation': coderAgent,
  'research': researchAgent,
  'review': reviewAgent,
  'deployment': deployAgent,
  'question': qaAgent,
}

3. Priority Queue

For multiple concurrent tasks: Set priorities (1 = highest). Deadline tracking prevents tasks from waiting forever.

4. Result Aggregation

The Orchestrator collects results from all sub-agents and synthesizes a final response.

Important Aspects

  • Timeout: Each sub-agent needs a max timeout
  • Retry: Max 2x on errors
  • Fallback: What if all agents fail?
  • Cost Control: Budget limits per task

Sources

Next step: move from knowledge to implementation

If you want more than theory: setups, workflows and templates from real operations for teams that want local, documented AI systems.

Why AI Engineering
  • Local and self-hosted by default
  • Documented and auditable
  • Built from our own runtime
  • Made in Austria
Not legal advice.