48 Agent Architectures Overview
48.1 Why this matters
Every model covered so far in this book answers a single query: predict the next token, classify an image, denoise a patch. An agent is different in kind, not just in scale. It runs a loop: observe, decide, act, and observe the result of that action, repeating until a goal is reached or a budget is exhausted. This loop is what Embodied AI runs physically and what a coding assistant or research agent runs virtually; the pattern is the same regardless of whether the “action” is a motor command or a function call.
48.2 The mechanism
48.2.1 The perceive-reason-act loop
Every agent runs this cycle, model-agnostic: perceive the current state (text, images, sensor data), reason about what to do given the goal and history, act on the environment, then perceive the new state and repeat. This is the physical-world loop from Embodied AI, generalized: the environment can be a robot’s surroundings, a filesystem, a web browser, or another agent.
48.2.2 Memory
An agent’s memory of past steps can live in three places, each with a different cost and capacity tradeoff.
- In-context: prior steps stay in the model’s context window directly. Simple, but bounded by context length and expensive to attend over as it grows (see Efficient Attention and KV-Cache).
- Retrieval: prior steps or external knowledge are stored in an index and fetched on demand. Unbounded capacity, at the cost of retrieval latency and imperfect recall; the full mechanism is covered in RAG.
- External state: an explicit scratchpad, file, or database the agent reads and writes directly, outside the model’s context entirely.
48.2.3 Planning
Chain-of-thought (Scaling Laws) is the simplest planning mechanism: reasoning tokens generated before the final action. More elaborate agents add tree search (explore multiple candidate action sequences before committing) or reflection (critique and revise a plan after seeing its outcome), trading extra inference-time compute for a better chance of reaching the goal.
48.2.4 Backbone vs. orchestrator
A single model can play two different roles in an agent system. As a backbone, it is the perceive-reason-act loop’s reasoning engine directly. As an orchestrator, it coordinates other components, calling tools (Tool Use), delegating to other agents (Multi-Agent Systems), or querying a retrieval index (RAG), without doing all the reasoning itself in one forward pass.
48.3 Landscape of agent architectures
| System | Backbone | Key capability |
|---|---|---|
| ReAct (Yao et al., 2022) | LLM | Interleaved reasoning and tool calls |
| Toolformer (Schick et al., 2023) | LLM | Self-taught tool use via fine-tuning |
| AutoGen (Wu et al., 2023) | LLM | Multi-agent conversation and orchestration |
| Generative Agents (Park et al., 2023) | LLM | Simulated agents with memory and social behavior |
| RT-2 / OpenVLA | VLA Transformer | Embodied physical action |