Duyetbot Agent
Concepts

Orchestrator Agent (LEGACY)

DEPRECATED - This document describes the legacy OrchestratorAgent which was removed in December 2024.

DEPRECATION NOTICE: This document describes the legacy OrchestratorAgent which was removed in December 2024 as part of the loop-based agent refactoring. The system now uses a single CloudflareChatAgent with tool iterations and the plan tool for task decomposition. See architecture.md for current implementation.

Legacy Documentation

TL;DR (Historical): Planned high-complexity tasks. Dispatched parallel Code/Research/GitHub Workers. Aggregated results. Router -> Orchestrator -> Workers.

Table of Contents

Flow

    Router Routes
   (high complexity)
          |
          v
  OrchestratorAgent
          |
          v
  Planner: LLM Plan
          |
          v
 Executor: Group Levels
          |
          v
 Parallel Workers
     Level 1
          |
          v
 Parallel Workers
     Level 2
          |
          v
 Aggregator: Synthesize
          |
          v
  Final Response

Key: Dependency levels enable parallelism. Continues on worker errors.

Parallel Execution

LevelStepsWorkersExample
0No depsResearchWorker"Latest React docs"
1Deps L0CodeWorkerReview code after research
2Deps L1GitHubWorkerComment on PR

Planner -> orchestration/planner.ts

Executor -> Levels via topological sort.

Code Snippet

packages/cloudflare-agent/src/orchestration/executor.ts

const stepGroups = groupStepsByLevel(plan.steps);
for (const group of stepGroups) {
  await Promise.allSettled(group.map(step => executeStep(...)));
}

Quiz: Orchestrator vs Router?
A: Orchestrator executes multi-step; Router single dispatch ✅

Related: Workers -> | Router ->

Try: @duyetbot "Research React hooks, review code, comment PR" -> Orchestrator live!

On this page