Machine Learning pathway increased my salary by 40%
Multi-Agent Architecture, Design Patterns and Enterprise System Engineering
Architecture is the set of decisions that are expensive to reverse. In a multi-agent system those decisions are about who owns state, who may act, what each agent can see, and what happens when a step fails — not about which framework is fashionable.
This chapter builds the engineering blueprint: orchestration topologies from centralised supervisors to decentralised negotiation, the agent lifecycle and its state machine, short-term and long-term memory, context engineering, routing and delegation, dependency management, and the fault tolerance and scalability properties an enterprise requires. It closes with the design documentation and trade-off records that let a second team operate what the first team built.
What this covers
- Who this is for
- Solution and platform architects, senior engineers building agent runtimes, and technical leads accountable for reliability of autonomous processes.
- What it assumes
- Chapter 01, plus familiarity with service-oriented design, APIs, message queues and basic distributed-systems failure modes.
- What you will be able to do
- Select an orchestration topology against stated constraints, define agent contracts and state ownership, design memory and context strategy, specify failure and recovery behaviour, and write the architecture record that makes the design reviewable.
- Reading time
- About 25 minutes including the question bank and glossary.
The component model of an enterprise agent system
Every production agent system decomposes into the same six concerns, whether or not a framework names them. There is an entry surface that receives work — an API, a queue, a scheduled trigger or a human action. There is an orchestrator that decomposes the goal and decides sequence. There are agents, each with a role, a prompt, a model, a tool set and a permission scope. There is a tool layer that mediates every external effect. There is a state and memory store that survives a single invocation. And there is an observability plane that records intent, action, result and cost as a trace.
The most consequential architectural choice is where the orchestrator sits relative to the agents. If orchestration is itself an agent, its reasoning is flexible but its control flow is probabilistic. If orchestration is a deterministic engine, the flow is auditable but adapting to novelty requires explicit branching. Production systems usually combine both: a deterministic engine that owns the outer states, and an agent supervisor that handles the decomposition inside a single state.
The tool layer is where security actually lives. An agent cannot exceed what its tools allow, provided the tools validate arguments and enforce their own authorisation. That makes tool design a security control, not a convenience wrapper: each tool should expose the minimum capability required, validate input types and ranges, apply the caller's identity, and record what it did.
- Entry surface
- Where work enters the system: webhook, queue consumer, scheduled job, or human-initiated action.
- Orchestrator
- The component that decides decomposition and sequence, either deterministically or by reasoning.
- Agent contract
- The declared inputs, outputs, tools, permissions and failure behaviour of a single agent role.
- Tool layer
- The mediation boundary through which every external read or write passes, enforcing scope and validation.
- State store
- Durable storage of workflow state and memory that survives process restarts and model calls.
- Trace
- The correlated record of every step, tool call, result and cost for one unit of work.
Orchestration topologies and when each fits
Centralised orchestration places one supervisor in control. It is the default for enterprise work because it concentrates accountability: one component decides, one component is evaluated, one trace explains the run. Its limits appear when the supervisor must hold too much context or when the work is genuinely parallel across domains with independent authority.
Hierarchical orchestration adds layers — a domain supervisor per business area, each managing its own agents, with a portfolio supervisor above. This scales context and ownership, at the cost of latency and of debugging across levels. It suits large shared-service functions where different teams own different agent fleets.
Decentralised designs let agents coordinate directly, through shared state, message passing or negotiation. They are attractive for resilience and for genuinely distributed authority, and they are much harder to assure: no single component can explain the run, and emergent behaviour is difficult to reproduce in a test. For regulated work, decentralisation should be a deliberate exception with compensating controls, not a default.
Choose the most centralised topology that meets the latency and ownership requirements. Decentralise only where a specific constraint demands it, and document the compensating observation strategy.
| Topology | Best for | Main risk | Audit difficulty |
|---|---|---|---|
| Centralised supervisor | Bounded processes, regulated decisions | Supervisor context overload | Low — one trace |
| Hierarchical | Multi-domain portfolios, team ownership | Cross-level latency and debugging | Moderate |
| Pipeline | Document flows with fixed stages | Brittle stage contracts | Low |
| Blackboard | Collaborative analysis, shared evidence | Write contention, stale state | Moderate |
| Decentralised / market | Resilience, distributed authority | Emergent behaviour | High |
The design patterns worth naming in a review
Supervisor-worker is the workhorse: the supervisor decomposes, assigns, validates and aggregates. Planner-executor separates thinking from doing, so the expensive reasoning happens once and execution stays cheap, observable and retryable. Sequential pipeline suits document processing where each stage transforms an artefact under a typed contract. Parallel fan-out with a synthesis step suits research, comparison and multi-source evidence assembly.
Competitive patterns — several agents attempting the same task and a judge selecting or merging — improve quality on tasks with an objective criterion and multiply cost. They are justified where the cost of a wrong output is high, and they should be capped in participants. Collaborative refinement patterns, where agents critique each other, are useful for drafting but risk convergence on a shared error, so at least one verifier should be grounded in external evidence rather than another model opinion.
Two anti-patterns recur. The first is the chatty chain, where agents exchange natural-language messages without typed contracts, so errors surface late and tracing is guesswork. The second is the single mega-agent pretending to be a system, where one prompt accumulates every role and instruction until no part of it can be tested. Both are signs that the decomposition was driven by framework features rather than by accountability.
- Supervisor-worker — decompose, assign, validate, aggregate. Default for enterprise processes.
- Planner-executor — one planning step, many cheap executions; retries are local to execution.
- Sequential pipeline — typed handoff between stages; strong for document transformation.
- Parallel fan-out and synthesis — faster wall clock, higher cost, needs a merge rule.
- Competitive with judge — quality gain on objective criteria; cap participants and cost.
- Critique and refine — useful for drafting; pair with an externally grounded verifier.
Agent lifecycle, state and dependency management
An agent run is a state machine, even when the framework hides it. The states that matter operationally are: queued, planning, awaiting tool result, awaiting human input, executing action, verifying, completed, failed and abandoned. If those states are not explicit and durable, a restart loses work, a timeout leaves an action half-applied, and nobody can answer what happened to a specific case.
State must be owned by exactly one component. In practice this means the workflow engine holds the authoritative case state and agents read a scoped view of it. Agents may propose changes but not commit them directly where a consequential effect is involved. This single rule eliminates most of the double-execution and lost-update failures seen in agent systems.
Dependencies need explicit management too. If agent C needs the output of agent A and B, the orchestrator must know that ordering, hold partial results, and define behaviour when one branch fails: proceed with degraded input, retry, or escalate. Dependencies expressed only through conversation are invisible to the engine and therefore impossible to schedule, retry or audit properly.
| State | Durable record | Timeout behaviour | Recovery |
|---|---|---|---|
| Queued | Case id, role, attempt | Requeue with backoff | Idempotent claim |
| Planning | Plan version, context hash | Fail to human queue | Re-plan with fresh context |
| Awaiting tool | Tool name, arguments hash | Retry once, then escalate | Idempotency key on tool |
| Awaiting human | Approver, requested act | Reminder then escalate | Resume from checkpoint |
| Executing | Action id, idempotency key | Never auto-retry writes | Verify effect before retry |
| Verifying | Verifier verdict, rule ids | Fail closed | Reject and escalate |
Memory, context engineering and retrieval
Short-term memory is the working context of a single run: the goal, the plan, the observations so far and the constraints. It is expensive and should be curated rather than accumulated. Long-term memory is anything that survives the run — case history, learned preferences, prior decisions, entity facts — and it belongs in a store with access control, not inside a prompt.
Context engineering is the discipline of deciding what the agent sees at each step. Three practices carry most of the value. Summarise rather than concatenate: replace long tool outputs with structured summaries that preserve decision-relevant fields. Retrieve narrowly: fetch the specific clauses, records or passages the step needs, with provenance, instead of a broad search dump. And separate instruction from evidence, so retrieved content is clearly framed as data — which is both a quality measure and a defence against injected instructions.
Memory architecture should mirror the distinction in the enterprise data model. Episodic memory holds what happened on a case. Semantic memory holds durable facts and policy. Procedural memory holds how to do things — often better expressed as deterministic tools than as text the model must follow. Working memory is the current context window. Mixing these into one vector store is the most common and most expensive memory mistake; it produces retrieval that is plausible but unauthoritative.
- Curate working context per step; do not carry the whole run forward.
- Summarise tool outputs into typed fields before they enter context.
- Attach provenance to every retrieved passage so grounding can be checked.
- Keep policy and procedure in versioned stores, not in prompts.
- Never merge episodic, semantic and procedural memory into a single undifferentiated index.
Fault tolerance, recovery and scalability
Distributed-system failure modes apply unchanged: timeouts, partial writes, duplicate delivery, and thundering retries. What is new is that a model can also fail silently by returning a confident wrong answer, so failure detection cannot rely on exceptions alone. The practical answer is that every write needs an idempotency key, every retry needs a ceiling and a backoff, and every consequential output needs a verification step that can fail the run.
Recovery design follows from state ownership. If the engine owns state and each action is idempotent, recovery is re-entering the last durable state. If agents own state in their context, recovery is impossible without replay, and replay is unreliable because the model may decide differently. That asymmetry is the strongest argument for keeping durable state outside the agent.
Scalability has two dimensions that are often conflated. Throughput scales by running many independent runs concurrently, which is straightforward if state is external and tools are stateless. Context scales much less well, because a single run that must consider everything degrades in quality as it grows. Large portfolios therefore scale by decomposition and narrow retrieval, not by larger context windows.
A write action must be idempotent and verified. If you cannot make an action idempotent, do not let an agent retry it — escalate instead.
Routing, delegation and model selection
Routing decides which agent or model handles a unit of work. Rule-based routing on structured attributes is deterministic, cheap and explainable, and should carry most of the volume. Semantic routing — classifying an ambiguous request and sending it to a specialist — extends reach but must be evaluated, because a misroute is invisible until the wrong agent produces a plausible wrong answer.
Delegation is routing with authority: the delegating agent must pass enough context for the receiving agent to act, must not pass more than the receiver is permitted to see, and must retain accountability for the composite outcome. A delegation record — who asked whom for what, with which scope — is the artefact that makes a multi-agent run auditable.
Model selection belongs here too. Enterprises increasingly route by difficulty: a small model for classification and extraction, a larger one for reasoning over conflicting evidence, a deterministic rule where neither is needed. Routing by cost and capability is a legitimate architectural decision, provided the evaluation set is stratified by route so quality is measured per path rather than only in aggregate.
Documenting the architecture and recording trade-offs
An agent architecture that exists only in code cannot be reviewed, funded or safely changed. The minimum viable record has six parts: a context diagram showing systems and trust boundaries; an agent register with role, purpose, tools, permissions, owner and evaluation set; a state machine for each process; a tool catalogue with argument schemas and authorisation rules; a failure and escalation matrix; and an architecture decision record for each consequential choice.
Decision records matter more here than in conventional architecture because the reasons for a decomposition are invisible in the code. A record that says why three agents were used rather than one, what was rejected, and what would have to change to revisit it, is what stops a future team from either over-engineering further or collapsing the design without understanding the constraints.
Two trade-offs recur often enough to deserve standing attention. Latency against verification: every additional check costs time and buys assurance, so the check set should be proportional to irreversibility. And autonomy against evaluation cost: the more the agent decides, the larger and more expensive the evaluation surface must be, which is why narrow scope is usually both cheaper and safer than broad scope.
- Context diagram with trust boundaries, not just components.
- Agent register: role, tools, permissions, owner, evaluation set.
- Process state machine with durable states and escalation points.
- Tool catalogue with schemas and authorisation per caller.
- Failure and escalation matrix per decision class.
- Architecture decision records stating rejected options and revisit conditions.
Key focus areas
- Component model
- Entry surface, orchestrator, agents, tool layer, state store and observability plane — the six concerns every design must answer.
- Orchestration topologies
- Centralised, hierarchical and decentralised control, and the audit cost of each.
- Supervisor-worker
- The default enterprise pattern: decompose, assign, validate, aggregate.
- Planner-executor
- Concentrating expensive reasoning in one planning step and keeping execution cheap and retryable.
- Typed handoffs
- Contracts between agents instead of free-text messages, so failures surface where they occur.
- State ownership
- Exactly one authoritative owner for case state, with agents proposing rather than committing.
- Idempotency
- Keys and verification that make retries safe, and the reason non-idempotent writes must escalate.
- Memory tiers
- Working, episodic, semantic and procedural memory kept separate and governed differently.
- Context engineering
- Summarise, retrieve narrowly, and separate instruction from evidence.
- Routing
- Rule-based by default, semantic where evaluated, with delegation records for accountability.
- Scalability axes
- Throughput scales with concurrency; context scales only by decomposition and narrow retrieval.
- Architecture record
- Diagram, agent register, state machine, tool catalogue, failure matrix and decision records.
- Trade-off discipline
- Verification proportional to irreversibility; autonomy proportional to evaluation capacity.
Key takeaways
- Six concerns must be answered explicitly in any agent architecture; frameworks name them differently but do not remove them.
- Decide whether orchestration is reasoning or deterministic before choosing a framework.
- The tool layer is the real security boundary, so tool design is architecture.
- Prefer the most centralised topology that meets latency and ownership needs.
- Typed handoffs between agents are a testability requirement, not a style choice.
- One component owns state; everyone else proposes.
- Every consequential write needs an idempotency key and a verification step.
- Do not retry non-idempotent actions — escalate them.
- Curate working context per step instead of accumulating it.
- Keep policy and procedure in versioned stores rather than in prompts.
- Separate episodic, semantic and procedural memory; mixed indexes retrieve plausible but unauthoritative content.
- Rule-based routing should carry most volume; semantic routing needs its own evaluation.
- Delegation passes scoped context and retains accountability for the composite outcome.
- Scale by concurrency and decomposition, not by enlarging context.
- If a decision cannot be explained from the architecture record, the architecture is not finished.
Glossary
- Agent contract
- Declared inputs, outputs, tools, permissions and failure behaviour for one agent role.
- Aggregation
- Combining outputs from multiple agents into a single result with an explicit merge rule.
- Checkpoint
- A durable saved state from which a run can be resumed after failure.
- Context window
- The bounded input an agent sees at one step, including instructions and evidence.
- Delegation record
- The record of who asked which agent to do what, with which scope and result.
- Episodic memory
- Case-specific history of what happened during a process instance.
- Fan-out
- Dispatching parallel subtasks to several agents from a single step.
- Idempotency key
- A unique identifier that lets a write be retried without duplicating its effect.
- Orchestrator
- The component that decomposes work and determines sequence.
- Planner-executor
- A pattern separating reasoning about the plan from execution of its steps.
- Procedural memory
- Knowledge of how to perform tasks, best expressed as tools or versioned procedures.
- Provenance
- The source and version attached to retrieved content so grounding can be verified.
- Semantic memory
- Durable facts and policy independent of any single case.
- State ownership
- The rule that one component is authoritative for a unit of work state.
- Supervisor-worker
- A coordination pattern where one agent assigns and validates work by others.
- Timeout policy
- Defined behaviour when a step exceeds its permitted duration.
- Tool catalogue
- The register of available tools with schemas, scopes and authorisation rules.
- Trace correlation id
- The identifier linking every step and tool call of one unit of work.
- Verification gate
- A check that must pass before a run advances to a committing state.
- Working memory
- The current context an agent operates over during a single run.
5 questions to test the model
Which component should be authoritative for the state of a long-running case?
Why are free-text handoffs between agents an anti-pattern?
A workflow step writes to a finance system and can be retried. What must exist?
Which memory mistake most often produces plausible but unauthoritative retrieval?
When is a decentralised topology defensible in a regulated enterprise?
Questions this page answers
Should orchestration itself be an agent?
How large should an agent role be?
How many tools should one agent have?
Do we need a separate state store from the workflow engine?
How is context engineering different from prompt engineering?
What should a tool return to an agent?
How do parallel agents merge results?
What is the right timeout policy?
Should each agent have its own identity?
How do we test a multi-agent system?
How do we keep latency acceptable?
What belongs in an architecture decision record for an agent?
How do agents get configuration and prompts at runtime?
What is the biggest scalability trap?
How do we handle a tool that intermittently returns bad data?
Should agents call each other directly?
What is the minimum viable observability set?
How do we prevent agents from duplicating work already done?
What documentation does an auditor actually ask for?
How does this chapter connect to Chapter 03?
What does Entry surface mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (The component model of an enterprise agent system)?
What does Orchestrator mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (The component model of an enterprise agent system)?
What does Agent contract mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (The component model of an enterprise agent system)?
What does Tool layer mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (The component model of an enterprise agent system)?
What does State store mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (The component model of an enterprise agent system)?
What does Trace mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (The component model of an enterprise agent system)?
What does Centralised supervisor mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Orchestration topologies and when each fits)?
What does Hierarchical mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Orchestration topologies and when each fits)?
What does Pipeline mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Orchestration topologies and when each fits)?
What does Blackboard mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Orchestration topologies and when each fits)?
What does Decentralised / market mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Orchestration topologies and when each fits)?
What does Queued mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Agent lifecycle, state and dependency management)?
What does Planning mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Agent lifecycle, state and dependency management)?
What does Awaiting tool mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Agent lifecycle, state and dependency management)?
What does Awaiting human mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Agent lifecycle, state and dependency management)?
What does Executing mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Agent lifecycle, state and dependency management)?
What does Verifying mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Agent lifecycle, state and dependency management)?
What does Component model mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Key focus areas)?
What does Orchestration topologies mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Key focus areas)?
What does Supervisor-worker mean in Multi-Agent Architecture, Design Patterns and Enterprise System Engineering (Key focus areas)?
Sources and standards
- Model Context Protocol — architecture and concepts
Tool and resource interfaces used as the mediation boundary in this chapter.
- LangGraph documentation — durable execution and state graphs
Reference implementation of durable agent state and checkpointing.
- Microsoft Agent Framework documentation
Orchestration patterns and enterprise integration guidance.
- NIST AI RMF — Map and Measure functions
Risk framing applied to architecture decisions.
- Site Reliability Engineering — distributed system failure modes
Timeouts, retries and idempotency patterns adapted to agent execution.
- Multi-agent systems literature on coordination
Secondary research on coordination cost and shared-state designs.
Continue through the twelve chapters
Architecture is settled before orchestration makes sense. Chapter 03 turns these components into running enterprise workflows.
Continue this lesson with a subscription
Multi Agentic Enterprise Workflow Automation is part of the paid catalogue. You have read the free preview. A subscription opens the rest of this lesson, the classroom slides and the assessment questions.
- The full lesson for this topic and every other catalogue topic
- Every classroom slide deck and worked example
- All assessments, with a verifiable certificate on completion
The Free-To-Learn library stays open to everyone and is not affected by this.
