Mod 1.7Common Agentic Design Patterns
Level 1›Module 1.7
Level 1: Foundations & ArchitectureModule 1.7

Common Agentic Design Patterns

Design Patterns

Level 1 • Foundations & Architecture
Est. ~72 mins
5 Key Topics
🎁 Free Learner Perk

Unlock Verified Certificate & Daily Streak Tracker

Ready to master Common Agentic Design Patterns? Enable cloud sync to record your daily streak 🔥 and earn your Informational Completion Badge for your study milestones.

Day 1 Streak ActiveFree Completion BadgeSync Laptop & Phone

🎯 By the end of this module, you will:

Master proven agent design patterns: ReAct, Reflection, Orchestrator-Workers, & Time Travel
Understand why ReAct cuts hallucinations from 14% down to 6% on HotpotQA
Implement Actor-Critic reflection loops that self-correct security and syntax bugs
Leverage persistent checkpointing to rewind and fork agent state with zero wasted work
Section 1 • Architectural Blueprints

Directing a Hollywood Film vs. A Lone Solo Creator

In production, you cannot deploy a single unconstrained loop and expect it to magically handle everything. Big systems require proven design patterns to ensure predictability, auditability, and speed.

Just as software engineering evolved MVC and microservices, agentic AI has developed canonical patterns: ReAct, Reflection, Orchestrator-Workers, and Checkpoint Time-Travel.

📹 The Solo Amateur (Monolithic Agent)

One person attempts to write the script, operate the camera, perform the stunts, record audio, and color grade simultaneously. They get overwhelmed, miss crucial flaws, and produce a shaky final cut.

🎬 The Hollywood Crew (Agentic Design Patterns)

A specialized director coordinates a cinematographer, a stunt coordinator, and a dedicated film editor. Independent review passes ensure cinema-quality perfection before the film hits theaters.

✍️
Instructor Note • Start Simple First

"Beginners always rush to build complex 8-agent swarm systems. In production, 80% of problems are solved with a simple 2-step ReAct pattern or an Actor-Critic reflection pass. Master the foundational patterns before adding multi-agent complexity!"

Section 2 • Architectural Topologies

The 4 Foundational Design Patterns

Select a design pattern below to inspect its topology and code implementation:

Pattern: 2. ReflectionEvaluator-Optimizer
Code Blueprint

Actor drafts an initial output; an independent Critic scores it against strict rubrics for self-healing.

# Reflection Loop (Self-Correction)
draft = actor.generate_code(spec)
critique = critic.evaluate(draft, rubric=["security", "performance"])
while critique.has_vulnerabilities and turns < max_retries:
    draft = actor.refine(draft, feedback=critique.issues)
    critique = critic.evaluate(draft)
💡
Mental Model • Author and Editor

"The Reflection pattern is simply the relationship between a novelist and their copy editor. The author writes freely with creative flow; the editor reads with critical eyes for plot holes and typos. Together, they produce masterworks!"

Section 3 • Pattern Selection Matrix

When to Use Which Pattern

Selecting the right pattern for your problem balances accuracy against latency and token cost:

ReAct (Single Agent + Tools)Fast & Grounded

Best for: Information retrieval, customer support lookups, and tasks requiring 1 to 5 sequential tool queries.

Reflection (Actor-Critic)Maximum Accuracy

Best for: Complex code generation, translation, legal contract drafting, and high-consequence calculations.

📌
The Single-Agent First Rule

"Exhaust single-agent patterns (ReAct with structured outputs and Reflection) before reaching for multi-agent swarms. Single agents are 10x easier to debug, have predictable latency, and don't suffer from inter-agent communication drift!"

Section 4 • Interactive Pattern Explorer
Interactive Pattern Catalog5 Canonical Topologies

Proven Agentic Design Patterns

Select a design pattern to inspect its architectural topology, real-world applications, and engineering trade-offs

Structural Decomposition

Planning & Replanning

Deconstruct, Order, and Dynamically Adapt

The agent explicitly breaks an ambiguous objective into an ordered sequence of discrete subtasks before executing, and dynamically refines the plan as new observations arrive.

Execution Flow Topology
1User Goal ➔ Planner Node (LLM decomposes into Step 1, Step 2, Step 3)
2Executor Node ➔ Executes Step 1 via Tools
3Plan Refinement Node ➔ Observes Step 1 output; updates/reorders remaining steps
4Termination Gate ➔ Concludes when all plan nodes reach SUCCESS
Production Example

Enterprise Tech Migration: (1) Audit dependencies ➔ (2) Check version compatibility ➔ (3) Rewrite deprecated APIs ➔ (4) Run test suite ➔ If tests fail, inject new bugfix subtask dynamically.

Engineering Trade-Offs

Higher initial latency before first action; potential over-planning on trivial requests.

Section 5 • Hands-On Pattern Laboratory

Interactive Design Patterns & Time-Travel Studio

Test the original ReAct reasoning trajectory, the Actor-Critic reflection loop, and human state rewinding

The Canonical ReAct Trajectory (Yao et al., 2023)Step 1 of 4
Query: "Who wrote the book that inspired the movie 'Blade Runner'?"
1. Thought 1

"I need to find out which book inspired 'Blade Runner' and who authored it."

2. Action 1 & Observation 1
Action: search("Book that inspired 'Blade Runner'")
Observation: "'Do Androids Dream of Electric Sheep?' by Philip K. Dick."
3. Thought 2

"Observation confirms the book is 'Do Androids Dream of Electric Sheep?' and the author is Philip K. Dick. Ready to output final answer."

4. Final Answer

"Philip K. Dick wrote 'Do Androids Dream of Electric Sheep?', which inspired 'Blade Runner'."

HotpotQA Benchmark: Hallucination Rates
Chain-of-Thought (Reason Only)14% Hallucination

Hallucinates ungrounded facts when missing external real-world knowledge.

ReAct (Reason + Act)6% Hallucination

Grounds reasoning in verified tool observations, cutting hallucinations by more than half!

Known Limitations of ReAct

1. Loop Exit Challenges: Can get stuck cycling the same thoughts without termination.
2. Single-Agent Bottleneck: Performance degrades as tool counts exceed 15-20 tools.

📝
Production Pro-Tip • Independent Critic Models

"When using Reflection, consider having a different, more powerful model act as the Critic (e.g., fast model drafts initial code; reasoning model critiques security). Models struggle to spot their own subtle blindspots when self-evaluating in the same prompt!"

Section 6 • Production Traps
TRAP #1: The Premature Multi-Agent Swarm

Splitting a simple workflow into 5 autonomous agents talking to each other. Inter-agent chatter explodes token costs and leads to conversational deadlocks.

Fix: Start with a single ReAct loop or deterministic DAG. Only branch to multi-agent when distinct tools or security scopes demand it.

TRAP #2: The Infinite Reflection Spiral

Allowing an Actor and Critic to endlessly nitpick stylistic trivialities without a stopping threshold.

Fix: Cap reflection passes at `max_reflections = 3`. If quality thresholds aren't met in 3 rounds, return the best candidate.

Section 7 • Key Takeaways & Quiz

Summary Checklist

Design patterns convert chaos into engineering: ReAct, Reflection, and Orchestration provide tested structural blueprints for reliability.
ReAct grounds thought in observation: Alternating reasoning with real-world tool execution slashes hallucination rates by more than half.
Time travel enables rapid human recovery: Saving state checkpoints lets engineers rewind, fix flawed arguments, and resume workflows without starting over.
Next Step in Level 1

Module 1.8: Short-Term and Long-Term Agent Memory

Explore in-context short term scratchpads vs persistent vector & relational long-term memory.

Proceed to 1.8