Agent Architecture Patterns
Choosing the right architecture is the most important design decision when building an AI agent.
ReAct (Reasoning + Acting)
The most common pattern. The agent alternates between thinking and acting:
Thought: I need to find the current weather in Tokyo
Action: search("Tokyo weather today")
Observation: Tokyo is 22°C and sunny
Thought: I now have the answer
Action: respond("The weather in Tokyo is 22°C and sunny")
Plan-and-Execute
The agent creates a full plan before taking any actions:
- Analyze the task
- Break into subtasks
- Execute each subtask sequentially
- Verify results
Best for complex, multi-step tasks where order matters.
Reflexion and Self-Correction
The agent evaluates its own outputs and iterates:
- Generate initial response
- Critique the response (find errors, gaps)
- Revise based on critique
- Repeat until satisfactory
Tool-Augmented Agents
Agents that extend their capabilities through external tools:
- Web search, calculators, code execution
- Database queries, API calls
- File operations, image generation
Router/Orchestrator Patterns
A central agent routes tasks to specialized sub-agents:
User query → Router Agent → [Research Agent | Code Agent | Writing Agent]
Key Takeaways
- ReAct is the default starting pattern for most agents
- Plan-and-Execute works best for complex multi-step tasks
- Reflexion improves output quality through self-critique
- Choose based on task complexity, latency requirements, and reliability needs