SYSTEM DESIGN REFERENCE
Agentic AI Architecture and System Design
An agent system connects model decisions to application state, tools and execution controls. This guide explains how those parts fit together, how to choose an architecture and how to reason about failure, using a support-agent example.
A production Agentic AI architecture places a controlled execution loop around one or more language models. The system receives a goal, assembles context, selects actions, calls permissioned tools, stores state and evaluates progress. Cross-cutting controls— authentication, tracing, approvals, limits, retries and rollback—keep flexible model decisions inside reliable software boundaries.
Agentic AI Architecture at a Glance
A production agent architecture is not a single component. It is a set of layers that separate concerns: who talks to the user, who reasons, who orchestrates, who remembers, who acts, who coordinates, and who watches. Each layer can fail independently, and each requires its own controls.
The model is one layer — the reasoning layer. It does not own state, enforce permissions, or guarantee safety. Application code does that. The architecture's job is to ensure that model decisions are executed within controlled boundaries.
How a Request Moves Through an Agent System
A user submits a goal through the experience layer. The orchestration layer assembles context from the context/retrieval/memory layer and passes it to the model layer. The model returns a decision — often a tool call. The tools layer executes the call within permission boundaries. The result flows back through orchestration, which updates state and evaluates progress. In multi-agent systems, the communication layer routes subtasks between agents. The control plane observes every step throughout.
This cycle repeats until the task is complete, a stop condition triggers, or the system pauses for human approval. Each pass through the loop is one trajectory step. The full sequence of steps is the agent's trajectory — which evaluation inspects alongside the final outcome.
The Core Layers of a Production AI Agent
Use the Architecture Layer Inspector above to explore each layer's responsibility, inputs, outputs, owned state, failure modes, required controls, and example tools. The following sections summarize each layer in prose for server-rendered accessibility.
Experience and Interaction Layer
The front door of the system. It renders agent responses, streams progress, and presents approval prompts. This layer translates between human intent and system calls. Poor interaction design — missing progress feedback, unhelpful error messages, or approval prompts that users dismiss — undermines even a well-engineered backend.
Model and Reasoning Layer
The language model interprets goals and selects actions. It is stateless between calls — the architecture manages all state. System instructions, tool definitions, and sampling parameters configure the model's behaviour. The model does not enforce constraints; it suggests actions within the framework the application provides.
Orchestration and State Layer
The control loop. Orchestration assembles context, invokes the model, executes tool calls, routes between steps, and manages checkpoints. This layer owns the agent's execution state, step count, and loop budget. Durable execution — checkpointing after each step so the agent can resume after failure — lives here. Compare frameworks by their orchestration and state model.
Context, Retrieval and Memory Layer
This layer manages what the model sees. It assembles the context window from conversation history, retrieved documents, and persistent memory. Context is ephemeral per call; memory is durable. Context budget management prevents overflow. Memory compression and selective retention prevent unbounded growth. Grounding checks ensure retrieved content is relevant and not contaminated.
Tools and Enterprise Systems Layer
Tools are the agent's hands. Each tool has a schema, permission scope, and audit trail. The system validates arguments before execution, runs tools within least-privilege boundaries, and logs every call. The Model Context Protocol (MCP) standardizes tool connections — see the security guide for MCP trust boundaries.
Agent Communication Layer
In multi-agent systems, this layer handles handoffs, message passing, and state synchronization. It adds coordination overhead, failure isolation challenges, and evaluation complexity. In single-agent systems, this layer is minimal. Do not add a communication layer unless multiple agents are justified.
Persistent Evaluation and Control Plane
The cross-cutting layer that watches everything. Tracing, evaluation, guardrails, approval gates, cost monitoring, and audit logging live here. This layer operates alongside the execution loop — it observes and governs but does not execute actions itself. Without it, the agent is opaque and unaccountable.
Selecting the Architecture
A single-agent architecture uses one model, one execution loop, and one set of tools. It is simpler to build, test, evaluate, and operate. State management is straightforward because there is only one execution context. Most production agent tasks can be handled by a single well-designed agent.
A supervisor-and-specialist multi-agent architecture routes subtasks from a supervisor to specialist agents. This adds: inter-agent handoff complexity, shared-state synchronization, higher latency from communication overhead, harder trajectory evaluation (you must trace across agents), and failure isolation challenges (one agent's failure can corrupt shared state). Use multi-agent only when distinct specializations or parallelism provide a concrete benefit that justifies these costs.
Microsoft's guidance recommends starting with a single agent and adding more only when a single agent cannot effectively handle the task. The added coordination cost must be justified — not assumed to be an upgrade.
State, Memory and Checkpoint Design
State is the agent's working data — progress, intermediate results, and execution context. Context is what the model sees in one call. Memory is persistent information across sessions. These three are distinct:
- Short-term context: Assembled per model call, bounded by the context window, evicted after the call.
- Checkpointed state: Saved after each step, enables resume after failure, stored in a durable store.
- Long-term memory: Persists across sessions, governed by retention policies, protected against poisoning.
Checkpoint design must be transactional: a partial state update after a failed step can corrupt the agent's progress. Use idempotency keys so a retried step does not execute twice. Version state to detect concurrent modifications in multi-agent systems.
Tool Boundaries, MCP and Enterprise Integration
Every tool an agent can call must have a defined boundary: what it can access, what arguments it accepts, what it returns, and what permissions it requires. The Model Context Protocol (MCP) provides a standardized way to define and connect tools. MCP does not grant trust — it provides a consistent interface. The security controls live in the application layer: least-privilege credentials, argument validation, sandboxing, and audit logging.
For enterprise integration, prefer tools that expose narrow, well-defined operations rather than broad database access. A tool that runs a specific query is safer than a tool that executes arbitrary SQL. Examine Agentic AI security controls for detailed MCP trust boundary guidance.
Where MCP and A2A Fit
MCP (Model Context Protocol) addresses the interface between an agent application and its tools. Use it when multiple clients or services need to share the same tool implementations, or when your tool ecosystem builds on it. MCP includes authorization mechanisms for supported transports, and your implementation must still enforce the permissions and business rules required by each action. An application can also connect tools directly without MCP when it has few tools in a single deployment.
A2A (Agent-to-Agent protocol) addresses communication between independently implemented agent services. Use it when separate agent services — potentially built by different teams on different stacks — need to exchange tasks and results. Local multi-agent orchestration inside one application does not automatically require A2A; intra-process handoffs are an application design choice.
Protocol adoption does not remove implementation responsibilities: input validation, permission checks, audit logging and recovery behaviour remain in your application regardless of which protocol connects the parts.
Worked System Design: A Support Agent
A support agent reads documentation, retrieves an authorized account record and requests approval for a restricted update. State exclusions: it does not escalate privileges, it does not act without an explicit approval reference, and it does not treat retrieved documents as instructions. The design below is illustrative until implemented and measured in your own environment.
Architecture
The authenticated actor context is established at entry and carried through the run. A runtime executes the controlled loop. Retrieval reads documentation with provenance. The tool boundary validates inputs and enforces resource scope. Approval gates any restricted write. Checkpoints persist execution state after each step. Observation points trace every model decision, tool call and state transition.
State outline
run ID; actor and tenant context; task status; pending action; approval reference; external operation reference; recorded result. Each field exists so that recovery can answer: what was about to happen, what actually happened, and what remains uncertain.
Tool contract
Inputs: account ID and update payload, validated against a schema. Output: recorded result with the external operation reference. Resource scope: the update is limited to the tenant the actor is authorized for, checked in code before execution. Authorization check: the authenticated actor must hold the update permission for that tenant. Idempotency behaviour: the write accepts an idempotency key so a retry after a lost response does not duplicate the update; the documented behaviour of the receiving API governs what a repeat call returns.
Failure walkthrough
A tool may complete its write but its response may be lost. The run becomes uncertain: the checkpoint shows a pending action without a recorded result. Recovery reconciles by querying the receiving system with the idempotency key or operation reference before any retry. If reconciliation cannot determine the outcome within its retry budget, the run escalates to a human with the evidence it has. The design treats a stop request as a record of what new actions will be prevented — it does not claim that completed external operations were reversed.
Evaluation outline
Cases: normal completion; a denied permission attempt; a denied approval; a question with missing evidence; a failed handoff; a lost response after the write; a restart from a checkpoint; and budget exhaustion. Each case states the expected behaviour and the evidence a reviewer inspects. Success thresholds are chosen from the task and the failure impact — the outline does not assert pass rates.
Observability, Evaluation and Human Approval
Every action an agent takes must be traceable. A trace records the goal, the model's decisions, the tools called, the arguments used, the results returned, and the state changes. Traces serve three purposes: debugging during development, evaluation during release, and audit during operation.
Human approval gates pause the execution loop before high-impact actions: sending payments, modifying production data, or performing irreversible operations. The approval prompt must show what the agent intends to do, not just ask for a yes/no. Learn how agents are evaluated for release-gate design.
Failure Recovery, Limits and Rollback
Agents fail. The architecture must handle failure gracefully:
- Retries: Retry transient failures with exponential backoff. Use idempotency keys to avoid duplicate execution.
- Timeouts: Every tool call needs a timeout. No agent should wait indefinitely for a hung service.
- Loop budgets: Maximum step count, maximum cost, and maximum runtime prevent infinite loops.
- Circuit breakers: If a tool fails repeatedly, stop calling it and fall back to an alternative.
- Rollback: For state-changing actions, design a rollback path. Checkpoints enable reverting to a known-good state.
- Fallbacks: If the primary model is unavailable, fall back to a simpler model or a deterministic response.
Agentic AI Architecture Decision Matrix
Use this matrix to make architecture decisions based on system requirements, not assumptions about what is “more advanced.”
| Decision | Option A | Option B | Choose A when | Choose B when |
|---|---|---|---|---|
| Agent count | Single agent | Multi-agent (supervisor + specialists) | One execution context handles the task | Distinct specializations or parallelism are required |
| State storage | In-process + checkpoint | Durable store (DB/Redis) | Short-lived agent, single session | Long-running or multi-agent, needs recovery |
| Tool protocol | Direct function calls | MCP servers | Few tools, single deployment | Many tools, cross-service, enterprise integration |
| Evaluation | Final-answer check | Trajectory + outcome evaluation | Simple Q&A, no tools | Multi-step, tool-using, safety-sensitive |
| Human approval | Post-hoc review | In-loop approval gates | Low-impact, reversible actions | High-impact, irreversible, or sensitive actions |
Common Architecture Mistakes
- Model as the architecture. Treating the LLM as the entire system. The model is one layer; state, tools, evaluation, and security are separate concerns.
- No checkpointing. An agent that cannot resume after failure must restart from the beginning — expensive and unreliable.
- Over-privileged tools. Giving an agent broad database or API access instead of narrow, purpose-built tool operations.
- Multi-agent by default. Adding multiple agents without justifying the coordination cost. Start with one agent.
- No control plane. Running an agent without tracing, evaluation, or audit. You cannot debug or trust what you cannot observe.
- Context and memory conflated. Treating the context window as persistent storage. Context is ephemeral; memory is governed separately.
Production Architecture Review Checklist
Frequently Asked Questions About Agent Architecture
What are the main components of an Agentic AI architecture?
Where should agent state be stored?
What is the difference between context and memory?
When should an architecture use multiple agents?
What is an agent control plane?
Where does MCP fit in an agent architecture?
How do you make an AI agent recoverable?
When does an architecture need MCP versus A2A?
Related Agentic AI Guides
ARCHITECTURE INTO IMPLEMENTATION
Build Agent Systems with Technical Reviews
Apply these design decisions in the 12-week Agentic AI course through six guided projects, a production capstone, and architecture and code reviews.
Reviewed by School of Core AI Technical Training Team
Sources and Methodology
This guide synthesizes architecture patterns from Google Cloud, Microsoft, LangGraph, and the MCP specification. The seven-layer model is an engineering reference, not a rigid standard. Layer boundaries may shift depending on framework and deployment. Framework capabilities were verified at the time of writing.
- Google Cloud — Architecture guidance for Agentic AIProduction architecture patterns and control planes.
- Microsoft — Guidance for single-agent vs multi-agent systemsWhen to use single vs multiple agents; orchestration patterns.
- LangGraph — Official documentationStateful graph orchestration, durable execution, checkpointing.
- Model Context Protocol SpecificationMCP for tool integration and trust boundaries.
Framework capabilities change. Verify current documentation before implementation. This guide avoids permanent statements such as “Framework X is always best.”