Applied AI

Shipped2026

Agentic Patterns

A 34-article blog series and companion code repository covering every major agentic design pattern, from a single augmented LLM call to multi-agent architectures, with runnable implementations in both raw OpenAI and LangChain or LangGraph.

Agentic Patterns

A 34-article blog series and the companion code repository that goes with it. The series names and explains every major agentic design pattern in current practice, from the simplest augmented single LLM call to large multi-agent architectures. The code repository ships runnable implementations of each pattern in two forms: a raw OpenAI Responses API version, and a LangChain or LangGraph version that solves the same problem with the same shape.

The series is aimed at engineers building production agentic systems who want a written reference they can read cover to cover and a code repository they can clone and run. Each pattern is grounded in primary sources: Anthropic's engineering writeups, OpenAI's agent guides, Google DeepMind's scaling study, the Microsoft MagenticOne paper, and the original academic papers for ReAct, Tree-of-Thought, Reflexion, LATS, and the Stanford Generative Agents memory architecture.

Overview

Detail Value
Category Applied AI, LLM engineering, agent architecture
Role Author, maintainer
Articles 34 published, 2026-02-16 through 2026-05-15
Repository subodhjena/agentic-patterns
Code lessons 16 of 30 complete (paired raw API and LangGraph versions from lesson 05)
Primary sources Anthropic, OpenAI, Google, Microsoft Research, academic papers
Frameworks covered LangGraph, LangChain, OpenAI Agents SDK, AutoGen, CrewAI, Google ADK, Claude Agent SDK
Protocols covered MCP (Model Context Protocol), A2A (Agent-to-Agent)
License Code: MIT. Written series: All Rights Reserved
Status Series complete, code lessons shipping through 2026

Why This Exists

The word agent has become so overloaded that design conversations about agentic systems routinely confuse three or four different architectures. A team reaching for "an agent" might mean a single prompt with a retry loop, a tool-calling ReAct loop, a multi-agent supervisor, a swarm, or a planner-generator-evaluator harness. Each has different operational costs, different failure modes, and different appropriate uses. Without a shared vocabulary, teams ship the wrong architecture for their workload and pay for it in bills, outages, or a slow erosion of user trust.

The Agentic Patterns series was written to make that vocabulary explicit. Each pattern gets one article and, where applicable, one paired code lesson. The tradeoffs, anti-patterns, and failure modes are called out directly. The opinion running through the series, drawn from Anthropic's guidance and reinforced by the DeepMind scaling study, is that the default should be the simplest thing that could possibly work, and complexity should be added deliberately rather than reflexively.

What the Repository Contains

flowchart LR
  subgraph Docs["docs/"]
    AP[agentic-patterns.md<br/>Theory reference]
  end
  subgraph Examples["examples/"]
    F[Foundations<br/>01-03]
    W[Workflows<br/>04-06, 10-11]
    A[Agents<br/>07-09]
    R[Reasoning<br/>12-15]
    M[Multi-Agent<br/>16-20]
    Mem[Memory<br/>21-22]
    S[Safety + Eval<br/>23-25]
    P[Production<br/>26-28]
    Syn[Synthesis<br/>29-30]
  end
  AP --> F
  AP --> W
  AP --> A
  AP --> R
  AP --> M
  AP --> Mem
  AP --> S
  AP --> P
  AP --> Syn

Every lesson from number 05 onward ships in two flavors: XX_topic.py uses the raw OpenAI Responses API, and XX_topic_langgraph.py uses LangChain or LangGraph. The two implementations solve the same problem and make the shape of the pattern explicit independent of framework. The first four lessons are foundational (a single LLM call, structured output, context engineering, prompt chaining) and are intentionally framework-free.

All 34 Articles

The series is organized into nine stages. Each stage builds on the previous one, but every article also stands alone as a reference for its specific pattern. All articles live under the agentic-patterns tag on the blog.

Stage 1: Foundations

# Article
1 Workflows Versus Agents in LLM Systems
2 The Augmented LLM: Retrieval, Tools, and Memory
3 Structured Output from LLMs
4 Context Engineering for Agents

Stage 2: Workflow Patterns

# Article
5 Prompt Chaining: Sequential LLM Pipelines with Validation Gates
6 Routing: Classify and Dispatch LLM Requests to Specialists
7 Parallelizing LLM Calls: Sectioning and Voting
8 Orchestrator-Workers: Dynamic Task Decomposition for LLM Agents
9 Evaluator-Optimizer: Iterative Refinement with a Separate Critic LLM

Stage 3: Agent Patterns

# Article
10 ReAct: Reasoning and Acting in One LLM Loop
11 The Tool-Calling Agent Loop: ReAct as It Actually Ships
12 Plan-and-Execute: Two-Phase Agents That Plan First, Then Act
13 The Agent-Computer Interface: Designing Tools for LLM Agents

Stage 4: Advanced Reasoning

# Article
14 Chain-of-Thought Prompting for LLM Reasoning
15 Tree-of-Thought: Branching Reasoning with Search for LLMs
16 Graph-of-Thought: Non-Linear Reasoning with Merge and Refine
17 Reflexion: Verbal Self-Critique After Failure for LLM Agents
18 LATS: Monte Carlo Tree Search for LLM Agent Decisions

Stage 5: Multi-Agent Systems

# Article
19 Supervisor and Router: A Central Agent That Delegates to Specialists
20 Hierarchical Teams: Supervisors of Supervisors in Multi-Agent Systems
21 Handoffs and the Swarm Pattern: Peer-to-Peer Agent Transfer
22 The Shared Scratchpad: A Common Workspace for Collaborating Agents
23 Group Chat Patterns: Round-Robin, Selector, and Swarm for LLM Agents

Stage 6: Memory

# Article
24 Short-Term and Long-Term Memory for LLM Agents
25 Generative Agents Memory: The Stanford Architecture for Persistent LLM Agents
26 Persistence and Checkpointing: Time Travel and Recovery for LLM Agents
27 Skills as Contextual Memory: Reusable Procedural Knowledge for LLM Agents

Stage 7: Safety and Evaluation

# Article
28 Human-in-the-Loop Patterns for LLM Agents
29 Guardrails for LLM Agentic Systems: Layered Defense
30 Agent Evaluation: LLM-as-Judge, Pass-at-K, and Benchmarks

Stage 8: Production

# Article
31 Harness Design: Planner, Generator, Evaluator for Production LLM Agents
32 Scaling and Cost Optimization for LLM Agentic Systems
33 MCP and A2A: Protocol Standards for LLM Agents

Stage 9: Synthesis

# Article
34 Choosing the Right Agentic Pattern: A Decision Framework

Running the Code Locally

The repository uses uv for package management. Clone, install, and run any lesson:

git clone https://github.com/subodhjena/agentic-patterns.git
cd agentic-patterns

# Install dependencies
uv sync

# Configure API keys
cp .env.example .env
# Edit .env and add OPENAI_API_KEY (and TAVILY_API_KEY if you want web search)

# Run a lesson
uv run python examples/01_basic_call.py
uv run python examples/08_react_agent.py
uv run python examples/11_orchestrator_workers_langgraph.py

Each lesson has a short module docstring that names the pattern it demonstrates and cites the section of docs/agentic-patterns.md that covers the theory.

Editorial Conventions

The series follows a small set of invariants that make the 34 articles feel like a single reference rather than a collection of posts:

  • One pattern per article. No composite posts.
  • Researcher voice. Precise vocabulary, claims cited where they are load-bearing, hedged where the evidence hedges.
  • At least one Mermaid diagram per article showing the structure of the pattern.
  • Two code excerpts per article. One without LangChain, one with. Each capped at roughly 25 lines, with a link to the full runnable version in the repository.
  • Numbered References section. Primary sources only, with hyperlinked titles.
  • Self-descriptive titles. A reader seeing the title out of context should know what the article is about.

The full plan and the lessons learned during publication live in docs/agentic-patterns-series-plan.md in the blog repository.

What I Learned Writing the Series

Three observations from the process of producing the series are worth naming.

Editorial invariants outlast editorial templates. Early articles used a rigid template (Premise, Intuition, Structure, Mechanics, ...). Readers noticed the repetition before they noticed the content. Switching to a set of invariants (diagram, two code excerpts, failure modes, numbered references) and letting each article choose its own heading structure produced a stronger reading experience without sacrificing consistency.

Tool design has more leverage than prompt tuning. The Agent-Computer Interface article cites Anthropic's report that a tool-testing agent rewriting tool descriptions produced a 40 percent decrease in task completion time. Writing the article reinforced the point: every production agent issue I have seen in the last year traces back to tool descriptions more often than to prompts.

Multi-agent architectures amplify error when the task is wrong for them. The Google DeepMind scaling study's specific numbers (17.2x error amplification for independent agents, 4.4x for centralized) reshaped how I present multi-agent patterns in the Multi-Agent stage. The default advice is no longer "multi-agent systems scale well" but "multi-agent systems scale well on parallelizable tasks and hurt on sequential ones".

Roadmap

The series is complete as written. The companion code repository is at 16 of 30 lessons and continues to add the remaining examples. Planned additions:

  • Lessons 17 through 30 covering hierarchical teams, handoffs, shared scratchpad, group chat, memory, persistence, HITL, guardrails, evaluation, harness design, cost optimization, MCP, cognitive architecture, and the capstone.
  • A small /tools directory with utilities used across lessons (common tool implementations, a shared Message type, and a skeptical evaluator prompt).
  • An example Skills directory under /skills illustrating the progressive-disclosure pattern covered in article 27.

Pull requests and issues are welcome on subodhjena/agentic-patterns.

agentic-patternsllmaiagentslangchainlanggraphopenaipydanticblog-seriesreference-implementation
← Back to all experiments