Kelly Router

Type: Multi-agent orchestration pattern

Definition

The Kelly Router is the reference architecture for multi-agent orchestration in OpenClaw. The Router (the main agent) never executes work directly — it only routes tasks to specialized leads, validates quality gates, and communicates with the operator. Named leads (research-lead, project-lead, test-lead) each orchestrate parallel sub-agents for their domain. This pattern solves the hard limits of a single agent: finite context window, sequential-only work, no specialization, and no self-check when things go wrong.

How It Works

The Router reads AGENTS.md at session start to understand its routing rules, named agents, intake procedures, quality gates, and escalation protocol. It then acts as the orchestrator: when a task arrives, it determines which lead handles it, spawns sub-agents under that lead, monitors progress, validates output quality, and escalates failures.

The key power move is parallel spawning. Instead of one agent doing three things sequentially (15 minutes), three agents handle three things simultaneously (5 minutes). The Router coordinates this without doing any of the work itself. For example, a research task might spawn three concurrent sub-agents investigating three different competitors, each returning findings that the Router synthesizes.

The Router also handles quality gates — before marking any task complete, it validates that output files exist, are non-empty, and actually address the original request. If a gate fails, the work goes back for revision or gets escalated via RALPH.

Communication flows through the Router: sub-agents report to their lead, leads report to the Router, and the Router reports to the operator. No direct sub-agent-to-operator communication. This keeps the Router aware of all state and able to coordinate effectively.

Key Properties

  • Routes, never does — the Router delegates all work; it orchestrates, doesn't execute
  • Named leads with domains — research-lead, project-lead, test-lead each handle specific task types
  • Parallel sub-agent spawning — concurrent execution replaces sequential work for 3x-5x speedup
  • Quality gate validation — output checked before task is marked complete
  • AGENTS.md driven — routing rules, agent configs, and escalation protocol read from operating manual
  • Single communication hub — all sub-agent to operator communication flows through the Router
  • ralph-protocol — the escalation protocol the Router uses when agents fail
  • quality-gates — the validation criteria the Router applies before accepting work
  • subagent-spawning — the tool mechanism for creating parallel worker agents

Source Chapters