Enterprises solve complex problems through organisational hierarchies: a VP decomposes annual strategy into department goals, directors coordinate teams against those goals, and individual contributors execute specific tasks. Agent hierarchies follow the same logic, and for the same reason. No single agent can hold the full context of an enterprise-scale goal while simultaneously knowing the exact API parameters for every tool it might need. Hierarchy is how you manage cognitive scope.
The Three-Tier Architecture
flowchart TD
H["Human Operator\n(provides strategic goal)"] --> E["Executive Agent\n(goal decomposition + allocation)"]
E --> M1["Manager Agent A\n(coordinate domain specialists)"]
E --> M2["Manager Agent B\n(coordinate domain specialists)"]
M1 --> W1["Worker: Data Extractor"]
M1 --> W2["Worker: Validator"]
M2 --> W3["Worker: Report Generator"]
M2 --> W4["Worker: Notifier"]
H -.->|"Override at any tier"| M1
H -.->|"Override at any tier"| W2
style H fill:#EEF0F7,stroke:#6366F1,color:#0F172A
style E fill:#EEF0F7,stroke:#6366F1,color:#0F172A
style M1 fill:#f0fdf9,stroke:#0D9488,color:#0F172A
style M2 fill:#f0fdf9,stroke:#0D9488,color:#0F172A
style W1 fill:#fff7ed,stroke:#f59e0b,color:#0F172A
style W2 fill:#fff7ed,stroke:#f59e0b,color:#0F172A
style W3 fill:#fff7ed,stroke:#f59e0b,color:#0F172A
style W4 fill:#fff7ed,stroke:#f59e0b,color:#0F172A
Executive agents receive high-level business goals and decompose them into sub-goals. They reason about dependencies between sub-goals, allocate sub-goals to the right manager agents based on domain expertise, and aggregate results into a coherent output. Executive agents carry rich context about strategy but thin context about execution mechanics.
Manager agents receive sub-goals from the executive and coordinate the specialist workers needed to accomplish them. They track progress, handle worker failures by reassigning tasks, and report upward. A manager agent for a financial analysis sub-goal knows which worker agents can extract data from Bloomberg vs Reuters, but it does not know the LLM prompt structure for the extraction, that lives in the worker.
Worker agents are narrow specialists. They accept a single well-defined task, execute it using a specific set of tools, and return a result. Workers should be stateless across tasks: they read from shared state and write results back, but they carry no memory of previous tasks. This makes them trivially replaceable and horizontally scalable.
Delegation Protocols with Accountability
Every delegation creates an accountability record: who delegated what, to whom, at what time, with what expected return criteria.
import uuid
from dataclasses import dataclass, field
from datetime import datetime, timedelta, timezone
from typing import Optional
@dataclass
class DelegationRecord:
delegation_id: str = field(default_factory=lambda: str(uuid.uuid4()))
parent_agent_id: str = "" # who delegated
child_agent_id: str = "" # who received the task
goal_description: str = ""
due_by: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
delegated_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
status: str = "PENDING" # PENDING | IN_PROGRESS | COMPLETE | FAILED
result: Optional[str] = None
failure_reason: Optional[str] = None
class ExecutiveAgent:
def delegate_to_manager(
self,
manager_id: str,
sub_goal: str,
slo_minutes: int = 30,
) -> DelegationRecord:
record = DelegationRecord(
parent_agent_id=self.agent_id,
child_agent_id=manager_id,
goal_description=sub_goal,
# WHY set due_by at delegation time rather than letting
# managers set their own deadlines: the executive owns the
# overall SLO. Managers must fit their work within the
# executive's constraint, not negotiate their own timeline
# after the fact.
due_by=datetime.now(timezone.utc) + timedelta(minutes=slo_minutes),
)
# Persist before sending: if the message queue fails after
# insert but before delivery, we can replay from the record.
self.state_store.save_delegation(record)
self.message_bus.publish(
topic=f"manager.{manager_id}.assignments",
payload={"delegation_id": record.delegation_id, "goal": sub_goal},
)
return record
The delegation record is the audit trail. When a manager completes its sub-goal, it updates the record’s status and result. When a manager fails or times out, the executive agent queries all open delegation records, identifies the overdue ones, and applies a reassignment or escalation policy.
Override Mechanisms
Human overrides must work at every tier without cascading side effects. The pattern is a control-plane state record that each agent checks before taking action:
sequenceDiagram
participant HO as Human Operator
participant CP as Control Plane DB
participant MA as Manager Agent
participant WA as Worker Agent
HO->>CP: Write override: {agent_id: "mgr-finance", action: "PAUSE"}
loop Every delegation cycle
MA->>CP: Check override for agent_id=mgr-finance
CP-->>MA: {action: "PAUSE"}
MA->>MA: Skip new delegations\nComplete in-flight tasks
end
HO->>CP: Write override: {agent_id: "mgr-finance", action: "RESUME"}
MA->>CP: Check override
CP-->>MA: {action: "RESUME"}
MA->>WA: Resume normal delegation
This approach gives operators surgical control. Pausing a manager does not require touching the executive or the workers. Redirecting a worker to a different tool configuration requires only a state update, not a redeployment.
Anti-Patterns to Avoid
Too many tiers is the most common mistake. Every tier adds a round-trip latency: the executive calls the manager, the manager calls a sub-manager, the sub-manager calls the worker. For a 4-tier hierarchy with 2-second LLM latency per hop, the minimum latency for a leaf task to report back to the top is 8 seconds. Three tiers is almost always sufficient; four or more requires extraordinary justification.
Manager micromanagement destroys the benefit of delegation. A manager agent that checks worker status every few seconds, re-issues instructions that are already being processed, or second-guesses worker tool choices is effectively operating as a slow, token-expensive version of a flat orchestrator. Managers should issue goals, set deadlines, and wait for completion events, not supervise execution step-by-step.
Opaque delegation chains make debugging nightmarish. Every delegation record must include the full chain of delegation IDs from the human-issued goal down to the current task. When a worker fails, you need to trace the failure back to which executive-level goal it was serving in under 60 seconds, which requires a queryable delegation graph, not scattered log entries.
The capstone lesson will bring together the full hierarchy, self-healing, scaling, and observability concepts into a complete production-grade enterprise agent platform.