Agentic Architectures Choose Karna: Decision-Driven Crash Course
Pattern selection par conceptual crash course: sequential workflow kab, single agent + ReAct + tools kab, planning + ReAct execution kab, multi-agent specialist system kab, aur reflection layer kab add karni hai.
*22 Concepts • 5 Decisions • Four learning tracks. Reader track 2-3 hours. Beginner, Intermediate, Advanced tracks roughly 1 day, 2-3 days, 4-5 days. Part 5 se pehle apna track choose karein.*
Anchor article: Bala Priya C, "Choosing the Right Agentic Design Pattern: A Decision-Tree Approach," Machine Learning Mastery, May 15, 2026. Decision tree ka spine un ka hai; deployment topology aur eval composition ka layer yeh course add karta hai.
Plain-English version
Aap agent build kar sakte hain. Ab sawal hai: next time kis type ka agent system build karna chahiye? Production AI ka real failure mode yeh hai ke engineers impressive-looking pattern choose karte hain, aksar multi-agent, jab task simple sequential workflow maangta hai. Opposite failure bhi real hai: one big agent use karna jab task genuinely specialists, planning, ya reflection maangta hai.
Pattern selection build se pehle design work hai. Paanch sawal task ke properties poochte hain. Answers aap ko starting pattern dete hain. Rule simple hai: simplest pattern choose karein jo task ki actual need match kare; complexity sirf tab add karein jab aap us property ka naam le sakte hain jo complexity demand karti hai.
Platform translation table
| Agent Factory reference | Common alternatives | Layer ka kaam |
|---|---|---|
| Inngest | Temporal, Restate, Step Functions, LangGraph | durable execution, triggers, HITL |
| OpenAI Agents SDK | LangGraph, AutoGen, CrewAI, Pydantic AI | agent loop, tools, handoffs |
| Phoenix / Arize | Langfuse, Helicone, LangSmith, Datadog | traces and evals |
| Azure Container Apps | Cloud Run, Fargate, Fly.io | harness runtime |
| Neon Postgres | Supabase, RDS, Cloud SQL | durable state |
| Cloudflare R2 | S3, GCS, Azure Blob | files and artifacts |
| Cloudflare Sandbox | E2B, Modal, Daytona | isolated code execution |
Glossary
- Agentic design pattern. AI agent system ki recurring architecture shape.
- Sequential workflow. Fixed pipeline jahan steps pehle se known hotay hain.
- ReAct. Reason, act, observe, repeat. Next action runtime par decide hota hai.
- Planning agent. Execution se pehle explicit plan banata hai.
- Reflection. Output generate, critique, refine. Cost add hoti hai; tab use karein jab criteria checkable hon.
- Multi-agent specialist system. Multiple role-specialized agents, router/supervisor ke saath.
- Failure signal. Runtime symptom jo batata hai pattern task se mismatch hai.
- Architectural fit. Pattern assumptions aur task properties ka match.
Prerequisites
- Aap ne pehla agent build kiya ho ya equivalent experience ho.
- Aap ko tool calls, structured output, aur agent loop samajh aata ho.
- Aap pseudocode read kar sakte hon.
- Eval aur cloud deployment courses helpful hain, required nahin.
Four learning tracks
| Track | Time | Outcome |
|---|---|---|
| Reader | 2-3 hours | Decision tree, patterns, failure signals |
| Beginner | ~1 day | Real tasks classify karna |
| Intermediate | 2-3 days | Deployment and eval implications sketch karna |
| Advanced | 4-5 days | Design review discipline team habit banana |
Part 1: Pattern-selection problem
Concept 1: Pattern selection build se pehle design work hai
Architecture ka pehla decision "kitne agents" nahin; "task ki shape kya hai" hai. Agar solution path fixed hai, agentic loop unnecessary ho sakta hai. Agar path adaptive hai, workflow brittle ho sakta hai.
Concept 2: Har pattern task ke bare mein different bet lagata hai
- Sequential workflow bet karta hai ke path known aur stable hai.
- ReAct bet karta hai ke next action runtime feedback se decide hogi.
- Planning bet karta hai ke high-level stages pehle nameable hain.
- Reflection bet karta hai ke quality criteria explicit aur checkable hain.
- Multi-agent bet karta hai ke specialization ya scale real bottleneck hai.
Concept 3: Overshooting aur undershooting
Overshoot: multi-agent jab workflow enough tha. Cost, latency, debugging explode. Undershoot: one big agent jab specialists chahiye thay. System superficially works, phir load par fail hota hai.
Part 2: Five-question decision tree
Concept 4: Q1 - solution path advance mein define hota hai?
Known path means steps before runtime likhe ja sakte hain. Unknown path means investigation ke baad next move pata chalta hai.
Concept 5: Q2 - workflow fixed aur stable hai?
Known path + fixed workflow = sequential workflow. LLM sirf extraction/generation step ho sakta hai; agent loop zaroori nahin.
Concept 6: Q3 - task structure advance mein articulable hai?
Structure articulable ho, lekin details adaptive hon, to planning + ReAct execution fit karta hai.
Concept 7: Q4 - quality speed se zyada important hai, aur criteria checkable hain?
Dono true hon to reflection layer earn karti hai. Criteria vague hon to reflection rubber-stamp ban jati hai.
Concept 8: Q5 - specialization, context, ya scale bottleneck hai?
Specialists tab add karein jab roles genuinely different hon, context ek model mein fit na ho, ya parallelism real speed/cost value de.
Concept 8.5: OpenAI Agents SDK primitives
Agent(...) atomic unit hai. Runner.run() loop chalata hai. @function_tool functions expose karta hai. handoff() specialist takeover hai. Agent.as_tool() coordinator-ke-control composition hai. output_guardrail reflection/validation primitive hai.
Concept 8.6: Operational envelope
Complex pattern zyada runtime machinery demand karta hai: durable steps, retries, concurrency, fan-out, HITL gates, trace IDs. Pattern choice deployment choice bhi hai.
Part 3: Five patterns in depth
Concept 9: Sequential workflow
Fixed sequence. Cheapest, most reliable, easiest to test. Use for invoice intake, data extraction, validation, notification.
Concept 10: Single agent + ReAct + tools
One agent, tools, adaptive loop. Use jab path unknown ho lekin one mental model enough ho.
Concept 11: Planning + ReAct execution
Planner stages banata hai; executor each stage mein ReAct use karta hai. Research, migration planning, complex reports.
Concept 12: Single agent + reflection
Generator output deta hai; critic explicit criteria ke against check karta hai. SQL generation, policy answers, regulated wording.
Concept 13: Multi-agent specialist system
Coordinator plus specialists. Use jab specialization, context separation, ya parallel execution coordination overhead justify kare.
Part 4: Failure signals and revision
Concept 14: Five failure signals
- Sequential workflow keeps needing exceptions.
- ReAct loop revisits solved work.
- Planner makes plans execution ignores.
- Reflection doesn't improve output.
- Multi-agent handoffs create more errors than value.
Concept 15: Targeted fixes
Pattern abandon karne se pehle small fix try karein: add step budget, split one tool, add one checkable rubric, move one stage to workflow, ya remove one specialist.
Concept 16: Jab decision tree wrong ho
Tree starting point hai. Runtime evidence stronger hai. If failure signals repeat, architecture revise karein.
Concept 16.5: Anti-pattern gallery
- "Multi-agent because impressive."
- "Planner for everything."
- "Reflection with vague criteria."
- "One giant prompt instead of tools."
- "Sequential workflow over genuinely adaptive task."
Part 5: Decision lab
Decision 1: Maya's Tier-1 Support agent
Most issues span billing, technical, account, refund. Routing specialists se friction zyada, value kam. Fit: single agent + ReAct + tools, with evals.
Decision 2: Incident response agent
Known phases but adaptive details: triage, diagnose, mitigate, communicate, postmortem. Fit: planning + ReAct execution.
Decision 3: Market research agent
Research, synthesis, critique. Fit: planning + ReAct, reflection on final report.
Decision 4: Enterprise onboarding agent
Fixed steps with approvals and data checks. Fit: sequential workflow with embedded LLM calls, not ReAct.
Decision 5: Coding agent
Advanced case: planner, executor, tests, review, sometimes specialist agents. Fit depends on codebase size and risk.
Part 6: Honest frontiers
Concept 17: Cost and latency constraints
Pattern choice token bill aur latency budget shape karta hai. Reflection and multi-agent multiply calls.
Concept 18: Pattern composition
Complex systems often use layers: planning at top, ReAct inside steps, reflection at end. Composition must still earn its cost.
Part 7: Closing
Concept 19: Connective tissue
Pattern selection connects build agents, production workers, eval discipline, and cloud deployment. Wrong pattern means wrong infra, wrong evals, wrong runbooks.
Cheat sheet
| Task property | Starting pattern |
|---|---|
| Fixed stable path | Sequential workflow |
| Unknown path, one mental model | Single agent + ReAct + tools |
| Nameable stages, adaptive inside | Planning + ReAct execution |
| Checkable high-cost errors | Add reflection |
| Real specialization/context/scale bottleneck | Multi-agent specialists |
Design-review template
- What is the task's solution path?
- Which steps are fixed, which are adaptive?
- What failure signal would prove this pattern wrong?
- Which deployment surfaces does this pattern require?
- Which eval scoreboard catches its specific failures?
References
- Bala Priya C, "Choosing the Right Agentic Design Pattern: A Decision-Tree Approach," Machine Learning Mastery, May 15, 2026.
- OpenAI Agents SDK documentation.
- Agent Factory eval-driven and deployment crash courses.