Every agent, regardless of framework, is built from the same handful of architectural pieces wired into a loop. This note is the map — each piece gets its own deep-dive page linked below.
The Full Architecture Diagram
Goal
↓
Context (goal + history + available tools + prior results)
↓
LLM reasoning/decision
↓
Tool selection
↓
Tool execution (after application validation)
↓
Observation
↓
State update
↓
Next action OR Final response
Each Piece, and Where to Go Deeper
| Piece | Role | Deep Dive |
|---|---|---|
| Goal | What the agent is trying to accomplish | Agent Goals |
| Context | Everything the LLM sees when making a decision | Agent Context |
| Decision-making | How the LLM reasons about what to do next | Agent Decision-Making |
| Actions | The concrete things the agent can do | Agent Actions |
| Observations | Reading back what happened after an action | Agent Observations |
| State | What persists across iterations of the loop | Agent State |
| The loop itself | How iteration and termination work | Agent Loop |
| Control flow | How the loop is actually implemented in code | Agent Control Flow |
Why Split Architecture Into This Many Pieces?
Each piece is a genuinely separate design decision when building a real agent: how you represent context affects cost and quality; how you design the action space affects reliability; how you persist state affects recoverability after a crash. Treating "agent architecture" as one monolithic concept skips over the actual engineering tradeoffs — this hub covers each piece individually specifically so you can reason about them separately.
Common Mistakes
- Treating "agent architecture" as just "prompt + loop" — state management, context design, and action validation are equally load-bearing, and are usually where production issues actually show up
- Copying an architecture pattern from a tutorial without understanding which piece is doing what — makes debugging much harder later
Interview Relevance
"Draw the architecture of an AI agent" is a near-universal system design question in agentic AI interviews — being able to reproduce this diagram and name each piece's responsibility is table stakes.
Practice Question
For a research agent that searches the web and writes a summary, list what would live in its context, its state, and its action space, using the definitions above.