Why Super Agents Need a Router/Worker Architecture

    A single, highly capable agent may work well for short demonstrations, but real-world workloads expose problems such as cross-task context contamination, exhausted context windows, and synchronous blocking. This article explains why Router/Worker layering addresses these issues, how clear task and result contracts preserve the boundary between the two layers, and when the added architectural complexity is not justified.

    Introduction: From “万能 Prompts” to Layered Architecture

    When developers first build an AI agent, they often follow the same pattern: choose a sufficiently capable model, connect a set of tools, and write an increasingly detailed system prompt in the hope that one agent can handle everything. This “monolithic super agent” approach can work smoothly in demonstrations. The task is usually narrow, the execution path is short, and the context is clean.

    Once the system enters a real business environment, however, tasks multiply, execution paths become longer, and concurrent requests appear. Problems quickly follow: responses become mixed up, latency becomes unpredictable, and the context budget is consumed rapidly.

    At that point, the issue is not necessarily the model’s intelligence. The underlying problem is the architecture. The Router/Worker architecture is an engineering approach designed to address these conditions. Its value becomes clearer when we examine why the pattern works, what problems it solves, and when it is not worth introducing.

    1. The Essence of Layering: Context Windows Are a Scarce Resource

    A common misconception is that layered agent architectures imitate corporate hierarchies, with the Router acting as a manager and Workers acting as employees. This analogy can be helpful, but it is not the fundamental reason for the design.

    The real driver is the tension between the limited availability of context-window resources and the different context requirements of heterogeneous workloads.

    The Router, or primary session and orchestration layer, needs a low-bandwidth, short-turn global view. It tracks multiple tasks at once: the current stage of each task, where a task is blocked, and which Worker should handle the next step. These decisions do not require every task detail. They mainly require task identifiers, status summaries, and key conclusions. The Router performs frequent, lightweight decisions.

    A Worker, by contrast, needs high-bandwidth, long-turn, detailed context. It performs the actual work: modifying code, running commands, and investigating failures. Error traces, previously attempted approaches, and raw tool output may each determine the next action. Worker activity is typically less frequent but involves long and intensive execution chains.

    If the same session performs both roles, information with different densities and lifecycles competes for the same context window. The clean global view needed for orchestration becomes buried in execution details, while the complete working context required for execution is diluted by summaries from other tasks. The context window is quickly exhausted, and neither role performs well.

    The purpose of layering is to physically isolate these two types of workload that would otherwise compete for the same context resource, allowing each context to serve a single responsibility.

    2. Two Traps a Monolithic Super Agent Will Eventually Encounter

    Trap 1: Cross-Task Context Contamination

    Assume that one agent is handling Task A and Task B at the same time. During Task A, the agent may generate a large amount of intermediate material, including rejected approaches, lengthy logs, and trial-and-error records. This information remains in the context window. When the agent begins handling Task B, it may mistakenly treat outdated conclusions from Task A as assumptions for Task B, producing an answer that appears reasonable but is actually based on the wrong context.

    Some developers try to solve this with prompts, such as instructing the model to “ignore previous content.” This is unreliable for two reasons. First, attention across a long context cannot be controlled precisely. Older information may still influence generation in unpredictable ways. Second, a prompt does not actually free any context-window capacity. The old information still occupies space.

    The reliable solution is physical isolation: run each task in an independent child session, with task contexts kept separate. After isolation, information can move between tasks only through explicitly defined channels, such as summaries and conclusions relayed by the Router. The contamination path is therefore eliminated at the architectural level.

    Trap 2: Synchronous Blocking and System-Wide Stalls

    The second trap is more subtle. If the primary session synchronously waits for a long-running command, such as a complete build or full test suite, it cannot receive new user messages or inspect the progress of other tasks until the result returns. From the user’s perspective, the entire agent appears to be frozen. From the system’s perspective, its orchestration capability has been locked by a single tool call.

    Layering resolves this conflict. After dispatching a long-running task to a Worker, the Router immediately becomes available again and can continue responding to new requests. The Worker completes the extended execution chain in its own session and reports back with a result summary.

    Orchestration and execution are thereby decoupled along the timeline, improving both system throughput and interactivity. Combined with asynchronous communication mechanisms such as message queues, this design can also support traceable task states and retry handling for failed tasks.

    3. Contract Design: Protecting the Boundary Between Layers

    Physical isolation is only the first step. If communication between the Router and Workers is not constrained, the layered architecture can quickly turn into another source of disorder.

    This is where contracts become important. The two layers need clearly defined formats for exchanging information.

    • Task-dispatch contract: When assigning a task, the Router should provide a clear task identifier, objective, necessary background summary, and completion criteria. It should not simply pass the entire conversation history to the Worker. This forces the orchestration layer to distill the relevant information before dispatching the task and controls the Worker’s initial context usage.
    • Result-reporting contract: After completing the task, the Worker should return the conclusion, key evidence, and status indicator rather than the full raw execution record. This keeps the Router’s context lightweight and allows it to maintain global orchestration over time.
    • Exception-escalation contract: When a Worker encounters an issue it cannot resolve independently, it should describe the blocker and required decision in a structured form. The Router can then decide whether to assign another Worker, change the approach, or ask the user for clarification, instead of allowing the Worker to loop indefinitely in its child session.

    The value of these contracts lies in replacing uncontrolled streams of natural language with a small amount of structured information. The boundary is protected both by physical isolation and by protocol discipline.

    For enterprise deployments, general cloud capabilities such as logging services, monitoring, and alerting can also be used to record each dispatch, execution, and report across the full workflow. This makes multi-task collaboration observable and auditable.

    4. When You Should Not Introduce a Layered Architecture

    No architecture is a universal solution. Router/Worker layering also has clear limits. Introducing it may not be worthwhile in the following situations:

    1. The task is simple and the execution path is short: For a single-turn question or a basic tool call, a monolithic agent with a well-designed prompt may be sufficient. Layering would only add engineering complexity and debugging overhead.
    2. Concurrency is extremely low: If multiple tasks do not coexist, there is no meaningful cross-task contamination or synchronous blocking to address. Isolation provides little value.
    3. Tasks are tightly coupled: If several subtasks must share a large amount of real-time intermediate state, forcing them into separate sessions may cause the contract channel to carry excessive data and create a new bottleneck.

    The decision can be summarized in one principle:

    Layering is justified only when context competition is a real problem and the benefits of isolation outweigh the coordination costs.

    Conclusion

    The Router/Worker architecture is not justified because it imitates an organizational hierarchy or because greater complexity is inherently better. Its foundation is a simple fact: the context window is a scarce resource, while orchestration and execution represent two workloads with fundamentally different resource profiles.

    By physically separating them and enforcing the boundary through explicit contracts, the architecture can address two structural weaknesses of monolithic agents: cross-task context contamination and synchronous blocking.

    For developers building multi-task agent systems, understanding why this architecture works is more valuable than memorizing its diagram. Only by understanding where the constraints come from can you make an appropriate trade-off for a specific workload.