Module 3 Wrap-up: The Strategic Architect
Hands-on: Design a planner-executor flow for a multi-step research task.
Module 3 Wrap-up: Designing Complex Flows
You have mastered the five core patterns of agentic AI. You know that ReAct is for simple turns, Planner-Executor is for deep work, Supervisors are for teams, Critics are for quality, and HITL is for safety.
Now, let’s bring them together in a design exercise.
Hands-on Exercise: The Competitive Intelligence Rig
The Goal: Build a system that monitors a competitor's website for price changes, analyzes the impact on our profit margins, and drafts a Slack message for the CEO—but waits for the Marketing Manager's approval.
1. Identify the Patterns Needed
- Planner–Executor: To break down the "Browse -> Analyze -> Draft" steps.
- Critic: To ensure the analysis math is correct.
- Human-in-the-Loop: For final approval before sending to the CEO.
2. The Architecture Diagram
graph TD
Start[User Trigger] --> Planner[Planner Agent]
Planner --> E1[Executor 1: Scrape Website]
E1 --> E2[Executor 2: Run Margin Analysis]
E2 --> Critic[Math Critic Agent]
Critic -- Fail --> E2
Critic -- Pass --> E3[Executor 3: Draft Slack Message]
E3 --> HITL[Human Approval Node]
HITL -- Approved --> Send[Slack API]
HITL -- Rejected --> E3
3. The Logic (Conceptual Python)
def competitive_intel_pipeline(competitor_url):
# Phase 1: Planning
plan = planner.generate_plan(f"Analyze pricing for {competitor_url}")
# Phase 2: Execution & Quality
results = []
for step in plan:
result = executor.run(step)
# Phase 3: Qualitative check
review = critic.audit(result)
if review == "BAD":
result = executor.run_retry(step, feedback=review)
results.append(result)
# Phase 4: Human-in-the-loop
final_draft = results[-1]
if request_human_approval(final_draft):
send_to_slack(final_draft)
Module 3 Summary
- Design Patterns are the templates for intelligence.
- The Planner pattern prevents "Drift" in long-running tasks.
- Supervisors allow for specialized experts to collaborate.
- Critics and Validators are the only way to reach production-level reliability.
- HITL is the mandatory bridge between autonomous AI and business responsibility.
Coming Up Next...
In Module 4, we start using the industry-standard framework: LangChain. We will learn how to turn these conceptual patterns into concrete Python code.
Module 3 Checklist
- I can describe the difference between ReAct and Planner-Executor.
- I understand why a "Critic" agent should have a different system prompt.
- I have identified 3 "Breakpoints" in my own business where HITL is needed.
- I can build a multi-step architecture diagram for a complex task.
- I understand the cost implications of running multi-agent loops.