The reference architecture
What it is
A production agent system has six layers, top to bottom, and four concerns that cut across all of them:
- API gateway: the front door. Authenticates, rate-limits and routes requests.
- Agent orchestrator: runs the loop or workflow, owns state and limits.
- Planner and reasoning engine: the model calls, behind a model gateway.
- Tool layer: validates, authorises and executes tool calls.
- Memory layer: run state, conversation history, long-term memory, document indexes.
- External systems: the databases, APIs and services the tools act on.
Cutting across: identity and authorisation, guardrails, observability, and asynchronous infrastructure (queues and workers).
Why it matters
Layers give each concern one home.
- A rule about who may call what lives in the tool layer, not scattered through prompts.
- A change of model provider touches only the model gateway.
- When something fails, the layers tell you where to look.
- The model is one box in a system that is mostly ordinary, well-understood infrastructure.
In the real world: A design review rejects a proposal whose diagram has no state store and no tool layer; the revised one adds both and the question 'what happens on a crash?' has an answer.
Visual example
Reference architectureIdentity, guardrails and tracing accompany it through every layer.
Drawing 'LLM' in the middle with arrows to everything. That diagram has no place for identity, limits or state, which is where production systems succeed or fail.