The Top 16 GenAI Patterns, agentic vs non-agentic
The 16 patterns most production GenAI systems use, split between the ones that act on the world and the ones that stay inside the prompt.
Eight patterns that act on the world, seven that reason inside the model, and one that crosses the line. Each comes with a diagram, the paper that started it, and notes from the field on where it shows up in real systems.
The two kinds of GenAI system
Every GenAI system in production leans one of two ways. Some reach outward and call tools, hit APIs, browse the web, take action. Others stay inward and think harder, longer, more carefully, but never leave the prompt. The choice is not stylistic. It decides cost, latency, how easy the system is to debug when it misbehaves, and what kinds of mistakes it can make.
The deciding question is always the same. Does feedback come from the world, or from the model itself? Agentic patterns close their loop on real outcomes. Non-agentic patterns close it on the model's own evaluations.
Each of the sixteen patterns has a diagram and a short writeup. Skip around and read what fits the problem you are working on right now. The rest is reference for later.
Agentic Patterns · Action-Oriented Intelligence
An agentic system acts on the world. It calls tools, hits APIs, watches the response, and decides what to do next. The feedback loop closes in reality, not in the prompt. Real systems are messy, and any agent that depends on them inherits the mess.
Reach for an agentic pattern when the answer depends on data you do not already have. Or when the task requires changing real state, or when the user expects the system to follow up on its own work.
01 · ReAct (Reasoning + Acting)
The agent alternates between thinking and acting. It writes a thought, something like what should I check next, takes an action (a tool call or API request), reads the result, and uses what it learned to write the next thought. The loop runs until the goal is met.
Stripped to its essentials, a ReAct loop is about 15 lines of Python on top of any modern function-calling API. The Thought lives in the assistant message content, the Action lives in tool_calls, and the Observation is the tool result you append before the next turn.
- Paper: ReAct: Synergizing Reasoning and Acting in Language Models · Yao et al., 2022 · Princeton + Google Brain · ICLR 2023.
- Code: Colab Notebook (full runnable version with tool definitions and a working web-search example).
- Use cases: web research, API integration, multi-tool workflows, interactive problem solving.
- Watch out: always cap max_iterations and a token budget. A loose ReAct loop will happily burn credits until your billing alert fires.
02 · Reflexion (Verbal RL)
After each attempt, the agent looks at what actually happened and writes a short reflection on why it failed. The reflection goes into memory. Next time the agent tries, it reads its own past reflections first. No weight updates, no fine-tuning, just a growing journal of what not to do again.
- Paper: Reflexion: Language Agents with Verbal Reinforcement Learning · Shinn et al., 2023 · Northeastern + MIT + Princeton.
- Code: Colab Notebook
- Use cases: code generation with execution feedback, robot navigation with physical trials, iterative task optimisation.
- Memory model: The reflection store is what CoALA (Sumers et al., 2023) calls episodic memory. Production agents in 2026 typically pair this with three other tiers, working memory (the current context), semantic memory (facts, retrieved via RAG), and procedural memory (tool schemas and skills). Letta and Mem0 are the most-used implementations.
- Watch out: episodic memory grows unboundedly. Add a TTL and salience scoring or the agent ends up retrieving stale reflections.
03 · Function Calling / Tool Use (with MCP)
Two complementary layers that ship together as one pattern in 2026. At the model layer, the LLM emits a structured JSON tool call instead of plain text. At the architecture layer, MCP (Model Context Protocol, Anthropic, Nov 2024) standardises how the host connects to many tools.
An MCP client speaks one protocol to many MCP servers, where each server wraps an external system and exposes tools, resources, and prompts over stdio or HTTP+SSE. Adding a new tool becomes a config change instead of an integration project.
Toolformer (Schick et al., 2023) showed for the first time that an LLM could learn when and how to call APIs without explicit human supervision. Modern function calling does not literally use Toolformer's self-supervised method. The labels come from RLHF and post-training instead. But the conceptual lineage is real. Toolformer made the case that tool use should be a first-class capability of the model, and that idea is now the default in every major API.
- Standard: Model Context Protocol · Anthropic, launched November 25, 2024 · open standard, now adopted by OpenAI, Google, AWS, and most agent stacks.
- Origin: Toolformer: Language Models Can Teach Themselves to Use Tools · Schick et al., 2023 · Meta AI · the precursor that proved LLMs can self-supervise tool use.
- Code: Model Context Protocol Notebook · Function Calling Notebook
- Use cases: every modern agent stack · OpenAI GPT-4 / Claude / Gemini tool calling · Claude Desktop and Cursor (via MCP) · parallel tool calls · multi-turn tool chains · enterprise tool registries.
- Mental model: The USB-C for AI agents. One client speaks the same protocol to many servers. The model decides what to call, MCP decides how to reach it.
- Watch out: OX Security disclosed a systemic command-injection class affecting MCP itself in April 2026, putting hundreds of thousands of MCP servers at risk across Cursor, VS Code, Claude Code, Gemini CLI, and Windsurf. Treat every MCP tool output as untrusted input, sandbox stdio servers, and pin and audit every server you install.
04 · Plan-and-Execute
A planner LLM writes out an ordered plan of subtasks. An executor (usually a smaller, cheaper model) walks the plan one step at a time. A replanner only kicks in when reality disagrees with what was planned. The trade is straightforward. You spend more tokens up front on planning, and save them later by not re-deciding the strategy on every step. It is the default choice in 2026 for any agent that needs to take more than a handful of actions. LangGraph's plan_and_execute and OpenAI Deep Research are the references to study.
- Paper: Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning · Wang et al., 2023 · Singapore Management University. The original two-phase prompting paper this pattern generalises.
- Reference: LangGraph plan_and_execute · LangChain, 2024 · the reference implementation. OpenAI Deep Research (Feb 2025) follows the same shape.
- Code: Colab Notebook
- Use cases: long-horizon research, enterprise multi-step workflows, complex data analysis, deep-research agents, any task where planning compute beats execution compute.
05 · Multi-Agent Collaboration (incl. Orchestrator-Worker)
Several specialised agents work on the same goal by passing messages to each other. Each agent has its own role and its own tools. The most common shape is Orchestrator-Worker. A supervisor agent breaks the goal into subtasks, hands each one to a worker (a researcher, a writer, a reviewer), then collects the results, handles any failures, and produces the final output. Hierarchical, sequential, and peer-to-peer setups exist too, but Orchestrator-Worker is what most production systems start with.
- Reference: Building Effective Agents · Anthropic, December 2024 · the reference taxonomy of multi-agent topologies (Orchestrator-Worker, Hierarchical, Sequential, Peer-to-Peer).
- Frameworks: CrewAI is the most-starred multi-agent framework in 2026 with role-based teams · LangGraph is graph-based and dominant in production state-machine setups · AutoGen is event-driven async, common in research.
- Code: Colab Notebook
- Use cases: research-write-review pipelines, customer support escalation, enterprise document workflows, parallel information gathering, complex multi-domain problem solving.
- Watch out: coordination overhead grows fast. Start single-agent. Only split into multi-agent once profiling shows a clear bottleneck that parallelism actually fixes.
06 · Retrieval-Augmented Generation (RAG)
Before the model answers, a retrieval step pulls relevant content from external knowledge (a database, a document store, or the web) and slips it into the prompt. The model is no longer limited to what it learned during training. The answer is grounded in whatever was just retrieved.
- Paper: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks · Lewis et al., 2020 · Facebook AI + UCL + NYU.
- Code: Colab Notebook
- Use cases: enterprise QA, document-grounded chatbots, research assistance, customer support, legal and compliance lookup.
- Evolutions worth knowing: Self-RAG (Asai et al., 2023) decides per-query whether to retrieve at all · Corrective RAG (Yan et al., 2024) re-queries on low retrieval confidence · Agentic RAG (2025 surveys) treats retrieval itself as a tool the agent calls in a loop.
- Watch out: embeddings are not mandatory. Keyword search via Elasticsearch or a SQL query is often faster, cheaper, and good enough. Reach for vector search only when the user query and the document language genuinely differ.
07 · Deep Research Agents
A deep research agent plans an investigation, runs multi-hop retrieval across many sources, browses dynamic web pages, and adjusts its plan as it finds new information. At the end it puts together a structured report. What sets these agents apart is autonomous depth. They run for minutes or hours of unattended work on a single query.
- Survey: Deep Research Agents: A Systematic Examination And Roadmap · Huang et al., 2025 · Liverpool + Huawei Noah's Ark + Oxford + UCL.
- Production: OpenAI Deep Research (o3 model, Feb 2025) · Gemini Deep Research (Gemini 2.5, 2025) · Grok DeepSearch (Feb 2025) · Anthropic Claude Research (2025).
08 · Agent-Computer Interface (ACI)
ACI is the idea that the surface an agent calls should be designed for the agent, not for a human. That means simple commands, compact operations, clear feedback after each step, and explicit ways to recover from errors. The SWE-agent paper from Princeton and Stanford was the first to lay this out for software engineering tasks. The same principles now show up in Anthropic Computer Use, OpenAI Operator, and Agent S.
- Paper: SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering · Yang et al., 2024 · Princeton + Stanford.
- Production: Anthropic Computer Use (Oct 2024) · OpenAI Operator (Jan 2025) · Agent S (Simular AI, Oct 2024).
- Use cases: software engineering automation, browser automation, desktop task automation, GUI testing.
Non-Agentic Patterns · Cognitive Intelligence
A non-agentic system stays inside its own head. The prompt goes in, the model thinks, the answer comes out. No tools, no APIs, no side effects on the world. That sounds limiting until you remember how much of what we actually need from an LLM is already sitting in the prompt. The reasoning is the work, and the patterns in this section are the techniques that pull it out cleanly.
Reach for a non-agentic pattern when the answer is fully expressible from what is already in the prompt. Or when latency or determinism matters, or when you cannot afford the operational complexity of tool use and side effects.
09 · Chain-of-Thought (CoT)
Add let's think step by step to the prompt, or include a few worked examples, and the model writes out its intermediate reasoning before giving the final answer. This is the prompt that turned LLMs from word completers into multi-step problem solvers.
- Paper: Chain-of-Thought Prompting Elicits Reasoning in Large Language Models · Wei et al., 2022 · Google Research.
- Code: Colab Notebook
- Variants: Zero-Shot CoT (let's think step by step) · Few-Shot CoT (worked examples in the prompt) · Self-Consistency (sample N chains, majority vote).
- Use cases: math word problems, logical reasoning, commonsense reasoning, step-by-step explanations.
10 · Tree of Thoughts (ToT)
At each reasoning step the model generates several candidate next-thoughts and scores them against the goal. It explores the most promising branches with BFS or DFS, and backtracks when a branch turns out to be a dead end. CoT writes one line of reasoning. ToT writes a tree.
- Paper: Tree of Thoughts: Deliberate Problem Solving with Large Language Models · Yao et al., 2023 · Princeton + Google DeepMind.
- Code: Colab Notebook
- Use cases: puzzle solving (24 game, Sudoku), creative writing, strategic planning, mathematical proof search.
In 2026, reasoning models like OpenAI o3 and o4-mini, Claude with extended thinking, and Gemini 2.5 Deep Think do something like ToT inside the model. They spend test-time compute on internal exploration before answering. If you are using one of these models, you may not need to implement ToT yourself. Reach for explicit ToT when you need the search structure to be visible, controllable, or auditable.
11 · Self-Refine
One LLM is both writer and reviewer. It writes a draft, critiques its own output for errors and weak spots, then rewrites based on the critique. The loop runs until the result is good enough. The simplest non-agentic self-improvement pattern, and surprisingly effective on coding and writing tasks.
- Paper: Self-Refine: Iterative Refinement with Self-Feedback · Madaan et al., 2023 · CMU + AI2 + UW + NVIDIA + UC San Diego + Google Brain.
- Code: Colab Notebook
- Use cases: code refinement, writing improvement, translation polishing, response optimisation, content summarisation.
12 · Plan-and-Solve
A two-step prompt. First the model writes a high-level plan. Then it works through each step with careful calculation. A zero-shot improvement over plain CoT on multi-step problems, and the prompt-only cousin of Plan-and-Execute (#04).
- Paper: Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning · Wang et al., 2023 · Singapore Management University + Singapore U. of Tech & Design + Southwest Jiaotong + East China Normal.
- Code: Colab Notebook
- Use cases: math problem solving, logical reasoning, planning without execution, stepwise explanation generation.
13 · Meta-Prompting
One LLM plays several expert roles inside a single response. A conductor breaks the task apart, routes each sub-question to a virtual specialist (a lawyer, a doctor, an engineer), and combines their answers into a coherent reply. There is no real multi-agent system here. It is structured role-play, all happening inside one model.
- Paper: Meta-Prompting: Enhancing Language Models with Task-Agnostic Scaffolding · Suzgun & Kalai, 2024 · Stanford + OpenAI.
- Code: Colab Notebook
- Use cases: multi-domain questions, simulated expert consultation, role-playing scenarios, multi-perspective analysis.
14 · Multi-Agent Debate
Several virtual agents each propose an answer, critique one another, refine their positions, and gradually converge on a consensus. All of this happens inside one model with no real tool use. The back-and-forth raises factuality and lowers hallucination rates compared to a single answer pass.
- Paper: Improving Factuality and Reasoning in Language Models through Multiagent Debate · Du et al., 2023 · MIT + Google Brain.
- Code: Colab Notebook
- Use cases: fact-checking, multi-perspective analysis, ethical and policy reasoning, scientific hypothesis testing.
15 · Chain-of-Verification (CoVe)
The model writes a baseline answer, then writes verification questions about its own claims. It answers each question independently, on a clean slate, so the original chain of thought cannot bias the check. Finally it revises the answer based on what the verifications turned up. A structured self-audit that noticeably reduces hallucinations.
- Paper: Chain-of-Verification Reduces Hallucination in Large Language Models · Dhuliawala et al., 2023 · Meta AI (FAIR) + ETH Zurich.
- Code: Colab Notebook
- Use cases: hallucination reduction, factual accuracy in QA, scientific summarisation, automated content review.
Hybrid · Self-Evolving Agents
This last one does not sit on either side of the line. A self-evolving agent updates itself over time, sometimes the weights, sometimes the prompts, sometimes the memory, sometimes the whole architecture. When the feedback driving the change comes from the world, the agent is acting on reality, so it sits with the agentic patterns. When the feedback comes from the agent grading itself in a sandbox, it sits with the non-agentic ones.
16 · Self-Evolving Agents (Borderline Hybrid)
- Code: Colab Notebook
- What evolves: weights, prompts, memory, architecture, or tool-usage strategy. Most teams only touch prompts and memory in practice.
- When it learns: online (the agent updates itself mid-task) or offline (it learns between tasks). Offline is safer to operate.
- How it adapts: reinforcement learning, imitation of expert data, evolutionary search, or reward shaping.
- Use cases: autonomous model improvement from user interactions · lifelong learners · on-device edge intelligence · AI copilots that adapt over months of use.
Most teams will never need this in practice. Master the other fifteen patterns first. A system that mutates its own runtime can break itself in ways you have not yet learned to debug.
At-a-Glance Comparison
A quick lookup table for what each pattern does and what kind of interaction it requires. Use it when you are picking a starting pattern. Jump back up to a pattern's section for the diagram and the source paper.
Agentic patterns
| Pattern | Key action | External interaction | Cost & latency |
|---|---|---|---|
| ReAct | Tool execution | APIs, tools, databases | Medium · 1 LLM call per loop iteration. Cap iterations |
| Reflexion | Task execution + verbal RL | Environment feedback + episodic memory | Medium-High · Action + Eval + Reflect each cost a call |
| Function Calling / MCP | Native structured tool calls | MCP servers, registries, function APIs | Low · 1-2 calls. Pay only for the tools that fire |
| Plan-and-Execute | Two-phase plan then execute | Plan steps + tool execution | Plan upfront with big model, execute cheap. Net medium |
| Multi-Agent Collaboration | Specialised agents collaborate (incl. Orchestrator-Worker) | Message passing between agents | High · 3-5x single-agent cost. Coordination overhead |
| RAG | Information retrieval | Database / vector store queries | Low-Medium · 1 retrieval + 1 generation. Cheap to scale |
| Deep Research | Multi-turn research | Web, APIs, browsers | Very High · minutes-to-hours of compute per query |
| ACI | Computer control | GUI, CLI, file system | High · screenshot + reasoning per action. Latency real |
Non-agentic patterns
| Pattern | Key feature | Interaction type | Cost & latency |
|---|---|---|---|
| Chain-of-Thought | Step-by-step reasoning | Internal only | Low · 1 call, slightly more output tokens |
| Tree of Thoughts | Path exploration with backtracking | Internal only | High · multiple calls per branch + scoring |
| Self-Refine | Self-critique + rewrite loop | Internal only | Medium · 2-3 calls per refinement cycle |
| Plan-and-Solve | Plan first, then solve | Internal only | Low · 1-2 calls |
| Meta-Prompting | Multiple expert personas | Internal only | Low-Medium · 1 long call covering all personas |
| Multi-Agent Debate | Virtual agents critique each other | Internal only | Medium-High · N agents x rounds of debate |
| Chain-of-Verification | Self-audit via verification questions | Internal only | Medium · 1 baseline + N verification calls |
When to Reach for Which
When choosing between patterns, work from the failure mode you are seeing right now. The wrong answer is never we should use a more sophisticated pattern. It is picking an agentic pattern when the work fits in one prompt, or a non-agentic one when the answer depends on data you do not have.
Use agentic patterns when you need...
- Real-time information gathering
- Tool and API integration
- Environment interaction
- Execution feedback from real systems
- Persistent state changes
- Multi-turn exploration
Use non-agentic patterns when you need...
- Better reasoning quality on a fixed prompt
- Complex problem decomposition
- Self-improvement loops
- Multiple perspective exploration
- Structured thinking
- No external dependencies
Pair an agentic and a non-agentic pattern
The two families combine well. The non-agentic pattern shapes the thinking, the agentic pattern grounds the result in the real world. A few combinations that show up often in production.
- Plan first, then act: Plan-and-Solve drafts an ordered plan, then a ReAct loop executes each step against real tools.
- Reason first, then fetch: Self-Refine sharpens the answer internally, then Function Calling verifies it or fills gaps with live data.
- Debate first, then act: Multi-Agent Debate weighs alternatives and picks the safest answer, then an ACI step carries out the resulting action.
Always wrap the high-stakes ones in HITL
Human-in-the-loop is not a pattern in this catalogue because it is not a reasoning shape. It is a guardrail that sits on top of any of these. Whenever an agent can spend money, change production state, send a message on someone's behalf, or take an irreversible action, route the decision through a human approval step before execution. ACI agents (Computer Use, Operator) and Plan-and-Execute agents in enterprise workflows almost always run with HITL on the destructive operations. The cost of the extra latency is small. The cost of the agent acting wrongly is not.
The patterns layer cleanly. Some nest inside others (Function Calling lives inside almost every agentic loop, MCP lives inside Function Calling), and most production systems combine three or four. Start with the simplest combination that solves the problem. Add complexity only where the failure analysis demands it.
Pattern catalogues are reference material, not curriculum. Pick what fits the failure mode you are actually seeing. The best architecture is the one with the fewest moving parts that still works in production.