Pattern | Category |
Reflection | Foundational agentic pattern |
Tool Use | Foundational agentic pattern |
Planning | Foundational agentic pattern |
Multi-Agent Collaboration | Foundational agentic pattern |
ReAct | Agent reasoning pattern |
Routing | Workflow pattern |
Prompt Chaining | Workflow pattern |
Parallelization | Workflow pattern |
1. Reflection. The agent drafts an answer, critiques it, then revises. Picture a coding assistant that writes a function, runs the tests, reads the errors and fixes its own bugs. It is the cheapest way to raise quality because it needs only a second prompt. Good prompt engineering techniques make the critique step far sharper.
2. Tool use. The agent calls external functions such as search, calculators, SQL queries or internal APIs. A finance assistant that pulls live exchange rates instead of guessing them is a simple example. This pattern fixes the stale-knowledge problem of LLMs.
3. ReAct (Reason and Act). Introduced in a 2022 paper by Yao and colleagues, ReAct has the agent alternate between a thought, an action and an observation. It suits research tasks where each result decides the next move.
4. Planning. The agent splits a big goal into smaller subtasks before touching any tool. In the plan-and-execute version, one step creates the plan and another carries it out. A trip-booking agent that lists flights, hotels and transfers first, then handles each in order, follows this pattern.
5. Routing. A classifier step sends each request to the right specialist prompt, tool or model. Customer support is the classic case, where billing questions and technical faults go to different handlers.
6. Prompt chaining. The output of one LLM call becomes the input of the next, with checks in between. It trades speed for accuracy and works well when a task has clear, fixed stages.
7. Parallelization. Independent subtasks run at the same time and the results are merged. Reviewing ten documents at once, rather than one by one, is a good fit.
8. Multi-agent collaboration. Several agents with different roles work toward one goal. This one needs its own section, so let us look at it next.
Multi-Agent Architecture and Coordination Patterns
A single agent with twenty tools tends to get confused. Its context fills up, it picks the wrong tool and its answers get vague. Splitting the work across specialised agents solves much of that.
How those agents talk to each other is the real design decision. These are the coordination styles you will meet most often.
Supervisor: One lead agent receives the task, delegates to workers and combines their results. It is easy to reason about but the supervisor becomes a bottleneck.
Hierarchical: Supervisors manage other supervisors, which suits large problems that break into departments.
Sequential pipeline: Agents pass work down a line, like an assembly process. Simple and predictable.
Peer-to-peer network: Agents message each other freely. Flexible, but hard to debug and easy to send into loops.
Debate or group chat: Agents argue different positions and a judge picks the best answer. Useful for reasoning-heavy questions.
Whatever style you pick, three things need attention.
First, shared state: agents need a common record of what has been done.
Second, termination rules: without a hard cap on turns, agents can talk in circles and burn tokens.
Third, error handling: one agent's wrong answer becomes the next agent's trusted input, so mistakes compound quickly.
Multi-agent systems also cost more. Every extra agent adds calls, latency and another thing to monitor.
Building AI Agents Using Agentic Design Patterns in Python
Python provides several libraries and frameworks for building AI agents that can reason, use tools, plan tasks, and evaluate their responses. You can build these patterns using basic Python functions, LLM APIs, or Agentic AI frameworks such as LangGraph and CrewAI.
Python Example: Building an AI Agent Using the Reflection Pattern
The reflection pattern allows an AI agent to generate a response, review it for errors, and refine it based on feedback.
The following example uses the OpenAI Python SDK to build a simple reflection agent.
Step 1: Install the required library
pip install openai
Set your OPENAI_API_KEY environment variable before running the code.
Step 2: Create the reflection agent
from openai import OpenAI
client = OpenAI()
def generate_response(prompt):
response = client.chat.completions.create(
model="gpt-4.1-mini",
messages=[
{"role": "user", "content": prompt}
]
)
return response.choices[0].message.content
# Generate the initial response
task = "Explain machine learning in three sentences."
draft = generate_response(task)
# Review the initial response
feedback = generate_response(
f"Review this answer for accuracy and clarity:\n{draft}"
)
# Refine the response using feedback
final_answer = generate_response(
f"Original task: {task}\n"
f"Draft: {draft}\n"
f"Feedback: {feedback}\n"
"Rewrite the draft using the feedback."
)
print("Initial Response:", draft)
print("Feedback:", feedback)
print("Final Response:", final_answer)
Step 3: Learn how the agent functions
Generation: The agent generates the first draft of the response according to the request from the user.
Reflection: The agent analyzes its response to check its accuracy, completeness, and clarity.
Refinement: The agent modifies its response according to the feedback generated.
Output: The agent returns the updated response back to the user.
This process can be expanded by including external services, memory, evaluation, or multiple reflection processes. For designing agentic patterns that are more complicated, the frameworks, such as LangGraph and CrewAI, help with managing the execution of the tasks and the coordination of the agents.
In this example, the single reflection process is used to reduce the cost of API calls and execution time. The code is not tested against the actual API.
Frameworks and Tools for Building Agentic AI Systems
You do not have to code every loop from scratch. Several frameworks ship ready-made versions of these patterns. Here is how the popular ones compare.
Framework | Best Suited For | Patterns It Handles Well |
LangGraph | Stateful workflows with branching, loops and human approval | Planning, reflection, routing |
CrewAI | Role-based agent teams with minimal setup | Multi-agent collaboration, sequential pipelines |
AutoGen | Conversational multi-agent setups and research prototypes | Group chat, debate, reflection |
OpenAI Agents SDK | Lightweight agents with handoffs and built-in guardrails | Routing, tool use, handoffs |
Google ADK | Agents running on Google Cloud | Hierarchical teams, tool use |
LlamaIndex | Data-heavy agents working over documents | Tool use, retrieval-based agents |
Frameworks evolve quickly, so check each project's documentation for current features before committing.
Do not forget observability. Tools such as LangSmith and Langfuse, along with practices from MLOps (Machine Learning Operations), record every step an agent takes, which makes debugging far less painful. Pair them with a solid grounding in Python for AI and LLM fundamentals, and you will move faster.
How to Choose the Right Agentic Design Pattern?
There is no single best pattern. The right one depends on the task, the budget and how much a mistake would cost. This sequence works well in practice.
Begin with the simplest option: A single LLM call with good retrieval solves more problems than people expect. Add structure only when it fails.
Look at the shape of the task: Fixed, predictable steps point to prompt chaining or routing. Open-ended problems point to ReAct or planning.
Decide how much accuracy matters: If errors are costly, add reflection or an evaluator step.
Count the cost and delay: Every loop multiplies tokens and response time, so set a maximum number of iterations.
Rate the risk: For actions that cannot be undone, such as payments or deletions, require human approval.
Go multi-agent only when you must: Overloaded context or clearly separate skills are good reasons. Habit is not.
Measure, then adjust: Build a small test set and track success rate, cost and latency before and after each change.
A practical rule of thumb: if you cannot explain in one sentence why a second agent is needed, you probably do not need one.
Also Read: Skills Needed for AI Jobs in 2026: Core Technical & Soft Skills
Conclusion
Agentic design patterns are less about clever tricks and more about discipline. The teams that get good results usually start small, add one pattern at a time and test each change. Reflection and tool use give the biggest return for the least effort, while multi-agent setups are best saved for problems that truly need them.
Pick a pattern, build a small version and watch how it fails. That is where the real learning happens.