Skip to main content

1.1 Agent architecture: workflows, agents, and hierarchies

The tier ladder​

Start at the simplest tier that meets the requirement and climb only when the requirement forces it (Building effective agents).

TierWhat it isControl flowUse when
Single callOne request, one response — classification, extraction, summarization, Q&ANoneThe task is fully specifiable in one prompt
WorkflowMultiple calls on a predefined path, orchestrated by your codeYou decide the sequenceSteps are known in advance; determinism and auditability matter
AgentModel decides which tool to call next until the goal is metThe model decides, in a loopThe path cannot be enumerated up front
Multi-agentA manager delegates to specialised subagentsManager decides delegation; subagents actWork fans out, or one context cannot hold it all
The most common item shape in this domain

"Is this a workflow or an agent?" A fixed sequence of known steps is a workflow, even if each step calls Claude. Reaching for an agent there buys nondeterminism, higher cost, and higher latency for nothing. Reaching for a workflow when the path is genuinely unknown produces a brittle decision tree that fails on the first unanticipated request.

Workflow patterns worth naming​

PatternShapeFits
Prompt chainingOutput of step N is input to step N+1, with programmatic gates betweenDecomposable tasks where each step is easier than the whole
RoutingClassify the input, then dispatch to a specialised prompt or modelDistinct input categories with different handling — cheap model for easy classes
Parallelization — sectioningSplit independent subtasks, run concurrently, joinLatency-bound work with independent parts
Parallelization — votingRun the same task N times, aggregateHigh-stakes judgment where variance is the risk
Orchestrator–workersA manager decomposes dynamically and delegates to workersThe number and shape of subtasks depends on the input
Evaluator–optimizerGenerator produces, evaluator critiques, loop until criteria metClear evaluation criteria exist and iteration measurably helps

Orchestrator–workers differs from sectioning in who decides the split: sectioning is fixed in your code, orchestration is decided by the model at runtime.

Should this be an agent at all?​

Four gates. A "no" on any one of them means stay at a simpler tier.

GateQuestion
ComplexityIs the task multi-step and hard to fully specify in advance?
ValueDoes the outcome justify higher cost and higher latency?
ViabilityIs Claude actually capable at this task type?
Cost of errorCan errors be caught and recovered — tests, review, rollback?

The cost of error gate is the one that disqualifies most tempting candidates: an autonomous agent acting on irreversible operations (payments, deletions, outbound messages) needs a deterministic gate or a human in the loop, not more prompt instructions.

Manager / supervisor hierarchies​

A manager (also called supervisor, orchestrator, or coordinator) owns everything the subagents do not:

Manager ownsSubagent owns
Decomposition of the goal into subtasksExecution of one scoped subtask
Delegation, including how many workers and with what inputsIts own tool calls within its scope
Aggregation and synthesis of resultsA single result returned to the manager
Error handling, retries, and re-delegationReporting failure honestly to the manager
The quality criteria each subtask is judged againstNothing about the other subagents

Subagent context is isolated. A subagent inherits nothing implicitly and shares no memory with its siblings — everything it needs must be passed in its prompt. Two consequences that items probe:

  • If every subagent reports success but the aggregate output has a coverage gap, the fault is in the manager's decomposition, not in the workers.
  • Passing raw content without metadata (source, URL, date, document name) makes the manager unable to reconcile conflicts or attribute claims.

What subagents actually buy​

BenefitMechanism
Context isolationA verbose exploration burns the subagent's context window, not the main one — only its conclusion returns
ParallelismIndependent subtasks run concurrently, cutting wall-clock time
SpecialisationA narrow system prompt and a scoped tool list per role beats one agent holding every tool
Least privilegeThe subagent that reads code never gets the tool that deploys it

They cost you: extra tokens for the delegation round-trips, latency on the manager's decomposition and synthesis turns, and a harder debugging story (a failure could be decomposition, delegation, execution, or synthesis).

Single agent first

A single agent with a well-described tool set handles most work. Move to a hierarchy when a concrete constraint forces it — context exhaustion, genuine fan-out, or a privilege boundary you need to enforce structurally.

Quiz​

  1. Question 1

    Every invoice goes through the same four steps: classify the document type, extract the fields, validate the totals against the purchase order, and post the result to the ERP. The steps never vary, and each one is separately testable. Which architecture fits?

  2. Question 2

    A manager agent splits a four-topic research brief into five subtasks, delegates one per subagent, and synthesises the results. Every subagent returns a complete, on-topic result; all five reach the synthesis step; none of the five contains any material on the fourth topic; and the report omits it. Where is the fault?

  3. Question 3

    A team is deciding between an autonomous agent and a workflow. Which fact argues most strongly for the agent?