Part 1: Foundations
Chapter 5: The Anatomy of an Agent Loop
At its core, every agent follows a simple loop:
- PERCEIVE — Take in information (user input, tool results, context)
- REASON — Decide what to do next (analyse, plan, choose action)
- ACT — Execute the chosen action (call a tool, generate output)
- OBSERVE — Check the result (did it work? what changed?)
- REPEAT — Continue until the goal is achieved or escalation is needed
This is sometimes called the ReAct pattern (Reason + Act) — the agent explicitly reasons about what to do before doing it.
What Comes Built-in vs What You Configure
Modern LLMs have ReAct-like reasoning baked in at a foundational level. When you give them tools, they naturally:
- Reason about what the user is asking
- Decide whether to use a tool or respond directly
- Observe tool results and continue reasoning
You don't have to explicitly instruct "think step by step, then act, then observe" — that's how the models work out of the box when tools are available.
The Platform's Role
The platform handles the orchestration loop:
- Sending the user's message to the model
- Executing tool calls when the model requests them
- Passing results back to the model
- Continuing until the model produces a final response
Your Instructions Shape How the Agent Reasons
Your instructions (DNA) shape how the agent reasons, not whether it reasons:
- What persona and tone to use
- What domain knowledge to apply
- When to use which tools
- What guardrails to follow
- When to escalate or defer
Key Insight
The model provides the reasoning capability. The platform provides the orchestration. Your DNA provides the specialisation and constraints that make the agent useful for your specific context.
