Patterns
The recurring orchestration patterns that show up across agent systems — ReAct loop, function calling, reflection, hierarchical planning, multi-agent shapes, human-in-the-loop, guardrails.
Patterns are the agent-design equivalent of design patterns in OOP: vocabulary for shapes that recur, not algorithms you implement once. The ReAct loop, the reflection cycle, hierarchical planning, multi-agent orchestration topologies — each is a way of organising the perception–reasoning–action loop to handle a class of problems.
Knowing the patterns matters more than knowing any specific framework. Every framework implements some subset of these patterns under its own names. Pattern-thinking lets you switch frameworks without losing your design intuition.
Key concepts
- Patterns describe loop topology — what flows in, what flows out, what loops back
- ReAct is the foundational pattern; almost every modern agent is a ReAct variant
- Multi-agent is not free — coordination overhead is real and often worse than a single capable agent
- Reflection helps when the task has a verifier; pure self-critique without grounding is just more hallucination
- Guardrails are pattern-shaped — pre-call validation, post-call filtering, action allowlists each cover different threats
Reference template
// When choosing a pattern, ask:
1. Does the task have intermediate observability? → ReAct
2. Does it need decomposition? → Hierarchical planning
3. Does it need diverse expertise? → Multi-agent
4. Is verification cheap and quality-bottlenecked? → Reflection
5. Is the action surface dangerous? → Guardrails + human-in-the-loop
6. Does it call structured APIs? → Function-calling Adapt to your problem; the structure is the load-bearing part.
Common pitfalls
- Reaching for multi-agent before a single agent is hitting a real ceiling — coordination cost usually outweighs the gain
- Stacking reflection on a model that's wrong about the same thing both times — verification needs grounding
- Treating guardrails as a single layer — defense-in-depth is the pattern, not a single check
- Forgetting human-in-the-loop on irreversible actions — the model can't unsend an email
Related topics
Items (7)
- The ReAct Loop
Reason, then act, then observe — the foundational interleaved-thought-and-tool-use pattern that powers most modern agents.
Pattern Foundational - Function Calling and Tool Use
Schema-typed tool calls as the agent's verb. Parallel calls, structured outputs, and the lifecycle of a tool invocation.
Pattern Foundational - Reflection and Self-Critique
Letting an agent review its own output before committing. Self-correction loops, judge-models, and the diminishing-returns curve.
Pattern Intermediate - Hierarchical Planning
High-level planner + low-level executor. When to decompose, how deep to go, and how to keep sub-plans aligned with the goal.
Pattern Intermediate - Multi-Agent Orchestration
Sequential, router, swarm, supervisor-worker. The four shapes of multi-agent coordination and what each costs.
Pattern Intermediate - Human-in-the-Loop
When and how to ask for human confirmation, feedback, or override. Designing the handoff so it's neither annoying nor unsafe.
Pattern Foundational - Guardrails and Safety
Pre-call validation, post-call filtering, content policies, action allowlists. The defense-in-depth pattern for agent safety.
Pattern Intermediate