How-To Guide
A phased, requirements-driven approach: extract capabilities from Arsanjani & Bustos's "Agentic Architectural Patterns for Building Multi-Agent Systems," implement each pattern, and assemble a production-ready coding agent.
Traditional tutorials show you how to build one specific agent — a chatbot, a coding assistant, a research tool. But they don't give you a framework for building any agent. They show you the pieces but not the why behind those pieces.
"Agentic Architectural Patterns for Building Multi-Agent Systems" by Dr. Ali Arsanjani and Juan Pablo Bustos (Packt, 2026) is different. It distills enterprise-grade agentic AI into a structured library of proven architectural patterns — each one a reusable solution to a specific challenge in building robust, scalable, multi-agent systems.
Our approach: Instead of following one tutorial, we treat the book's patterns as structured requirements. We use an AI agent (like Hermes) to extract, organize, and prioritize those requirements from the book. Then we systematically implement each capability and assemble a production-ready coding agent from the patterns.
A coding agent built on enterprise-grade agentic architectural patterns, extracted systematically from a published book, with each pattern as a verified, pluggable module ready for production use.
"Agentic Architectural Patterns for Building Multi-Agent Systems: Proven Design Patterns and Practices for GenAI, Agents, RAG, LLMOps, and Enterprise-Scale AI Systems" was written by Dr. Ali Arsanjani and Juan Pablo Bustos, published by Packt in January 2026 (574 pages).
The book is organized into two parts:
The book introduces a concrete, hierarchical multi-agent architecture where high-level orchestrator agents manage complex workflows by delegating sub-processes to specialized agents. Each pattern is backed by real-world scenarios and code examples using the open-source Agent Development Kit (ADK).
Note on source access: You have a physical or digital copy of the book. Use your copy to extract the detailed specifications for each pattern — the exact implementation guidance, prompts, and code examples. The O'Reilly preview only shows table of contents and index; you'll need the full book content for the pattern details.
Here are the key design patterns extracted from the book (from the index and chapter descriptions), organized by the phase they'll be implemented in:
Choosing the right model for agent tasks — FP16, FP32, INT8 quantization considerations for inference speed vs quality trade-offs
Pattern for agents to call external functions — the lowest layer of the agent stack
Contextual enhancement — grounding model output in external knowledge sources
Orchestrator-delegate hierarchy — one agent manages, others specialize
Standardized tool protocols for agents to interact with external systems
Structured agent collaboration — how agents communicate and pass work between each other
Agents automatically retry failed operations, with prompt mutation variants for different error types
Human-in-the-loop at designated intervention points — when to pause and request user input
Security patterns for multi-departmental analytics systems and access control for agents
Auditability, traceability, and governance patterns for regulated environments
Proactive testing — the agent tests itself against adversarial inputs and failure modes
Agent adaptation through prompt-based learning without retraining — for handling new task types
Domain specialization through parameter-efficient fine-tuning for persistent capability upgrades
Week 1–2
Before writing any agent code, we extract structured requirements from the book. This is where we train an AI agent (Hermes or Claude) to act as a product manager and systems analyst, reading your copy of the book and producing actionable specifications.
Since you have the book, use one of these approaches to digitize it for the requirements extraction agent:
Run a dedicated agent prompt to extract product-level requirements:
# Role: You are a product manager and systems analyst.
# Source: "Agentic Architectural Patterns for Building Multi-Agent Systems"
# by Dr. Ali Arsanjani and Juan Pablo Bustos (Packt, 2026)
# Task: For each agentic pattern in the book, extract:
1. What problem it solves (the "context" element)
2. The problem statement (when is this pattern needed?)
3. The solution structure (how does it work?)
4. Implementation guidance (from the book's examples)
5. Success criteria (how do we know it works?)
6. User scenarios where this pattern is essential
# Output: Structured JSON with "user_stories", "system_requirements",
# "capability_map" (pattern → capability), "prioritization" (MoSCoW)
Next, extract the technical specifications. The book's three-layer agentic architecture is critical:
A structured requirements document with: user stories mapped to patterns, the three-layer architecture diagram, prioritized capability list (MoSCoW), and an implementation roadmap that groups patterns into logical development phases.
Weeks 3–5
Now we build. The key is to implement patterns in the book's prescribed order — foundation first, then coordination, then safety. Each pattern becomes a Python module with a clear interface.
A library of 10+ agentic pattern modules, each tested and with a clean interface. The agent core has: LLM routing, RAG, function calling, orchestrator-delegate multi-agent coordination, MCP tool protocols, adaptive retry, human-in-the-loop, authentication, adversarial testing, and in-context learning. It's the engine — not yet a product, but a complete pattern-based architecture.
Weeks 6–7
Now we assemble the agent. We take the patterns built in Phase 2 and combine them into a functional coding agent — a concrete, working demonstration of the book's patterns in action.
# Coding Agent built on agentic architectural patterns
class CodingAgent:
def __init__(self):
# Pattern: Multi-Agent Coordination (Chapter 5)
self.orchestrator = OrchestratorAgent("task_decomposer")
self.specialists = {
"planner": SpecialistAgent("code_planner"),
"builder": SpecialistAgent("code_writer"),
"reviewer": SpecialistAgent("code_reviewer"),
}
# Pattern: LLM Selection & Adaptation (Chapter 2-3)
self.llm_router = ModelRouter({
simple_tasks: "gpt-4o-mini", # Fast, cheap
complex_reasoning: "claude-sonnet-4", # Strong reasoning
})
# Pattern: RAG (Chapter 3)
self.knowledge = KnowledgeRetriever("codebase_index")
# Pattern: Function Calling (Chapter 4)
self.tools = FunctionCallingLayer([
"read_file", "write_file", "shell_execute", "git_ops", "web_search"
])
# Pattern: MCP Tool Protocols (Chapter 4)
self.mcp_client = MCPClient(tools=self.tools)
# Pattern: Agent Calls Human (Chapter 6/7)
self.human_interface = HumanCallout(approval_required=["git_commit", "deploy"])
# Pattern: Adaptive Retry (Chapter 7)
self.retrier = AdaptiveRetry(
max_attempts=3,
mutation_strategy="prompt_reformulation",
)
# Pattern: In-Context Learning
self.icl = InContextLearner(
storage="memory_context",
retrieval_mode="similar_tasks",
)
# Pattern: Auth & Authorization
self.auth = AgentAuth(
roles={
"orchestrator": {"read", "write", "deploy"},
"planner": {"read", "plan"},
"builder": {"read", "write"},
"reviewer": {"read", "approve", "reject"},
}
)
async def execute(self, task: str) -> AgentResult:
# Step 1: Route to best model
model = self.llm_router.select(task)
# Step 2: Planner orchestrates (multi-agent coordination)
spec = await self.orchestrator.plan(task, model=model)
# Step 3: Execute plan with pattern-based agents
results = []
for step in spec.steps:
try:
# Step 4: RAG for context
context = self.knowledge.retrieve(step.description)
# Step 5: In-context learning — apply past lessons
prior_lessons = self.icl.recall_similar(step.description)
# Step 6: Execute tools with MCP
output = await self.mcp_client.execute(
step.action,
params={"context": context, "lessons": prior_lessons},
)
# Step 7: Adaptive retry on failure
if output.failed:
output = self.retrier.retry(step, output)
# Step 8: Human-in-the-loop for critical ops
if step.requires_approval:
output = await self.human_interface.request_approval(output)
results.append(output)
except AgentError as e:
# Step 9: Adaptive retry with prompt mutation
results.append(self.retrier.mutation_retry(step, e))
return AgentResult(plan=spec, results=results, status="completed")
A fully functional coding agent built on enterprise agentic patterns. It takes a feature request, reads the codebase using RAG, plans via an orchestrator agent, delegates to specialist agents, retries failures adaptively, and requires human approval before committing. Each capability is a verified module derived from the book's architectural patterns.
Weeks 8+
With the coding agent working on basic tasks, you'll inevitably hit limitations. This phase is about iterating based on real development experience, applying additional patterns from the book only where they solve actual problems.
Iterative approach: Don't implement all patterns upfront. Add them based on actual agent failures. The book's own guidance is pattern-first, not implementation-first — patterns solve real problems, not hypothetical ones. Track which patterns your agent actually needs through production use.
A production-ready coding agent built on a comprehensive set of agentic architectural patterns from the book. It handles diverse coding tasks, self-improves through in-context learning, and has robust safety mechanisms. The entire system is a demo of how enterprise-grade patterns from published research can be systematically converted into working software.
Not every pattern is equally urgent. Use the Eisenhower matrix — which the book itself references in its governance and orchestration patterns — to decide what to implement first:
Multi-Agent Coordination (orchestrator pattern), Function Calling, RAG, Agent Calls Human, Adaptive Retry
These are the agent's core capabilities. Without them, the agent doesn't function.
LLM Selection, Agent Protocol (MCP), In-Context Learning, Agent Authentication
Important for quality and scaling but not needed for V1.
Agent Fine-Tuning, Advanced Multi-Agent Protocols
Useful but add only after the agent proves valuable in basic form.
Adversarial Testing, Compliance & Explainability, Advanced Red Teaming
Production-hardening patterns — add when deploying to real users.
The book uses the open-source Agent Development Kit (ADK) for its code examples. Here's the stack for our implementation:
| Component | Technology | Why |
|---|---|---|
| Language | Python 3.12+ | Industry standard for agents; matches the book's ADK examples |
| Agent Framework | LangGraph + ADK | State-based graph with maximum control; book uses ADK |
| LLM APIs | OpenAI + Anthropic | Multiple providers for cost optimization and failover |
| Vector Store (RAG) | PostgreSQL + pgvector | Proven, queryable, fits your existing stack |
| MCP Tool Server | FastMCP (LangChain) | Standard tool protocol implementation for agent tools |
| API | FastAPI | Same stack as ThinkSmart; async support, auto-docs |
| Testing | pytest + adversarial suite | Unit tests for each pattern module; red teaming for robustness |
| Deployment | Docker + VPS | Simple, cost-effective; you already know this stack |
❌ Implementing patterns without understanding them
Don't code a pattern based on its name alone. Read the full chapter, understand the design rationale from the book, then implement. Each pattern has nuances — the difference between a simple retry and an adaptive retry with prompt mutation matters a lot in practice.
❌ Over-engineering the requirements extraction
Start with a simple prompt that extracts the 7+ patterns as a feature list. You can always refine the requirements later. Don't spend weeks on requirements that take hours to produce.
❌ Skipping the coordination pattern
The book's core insight is that agents need orchestration, not just individual capabilities. Don't build a single-agent system — implement the multi-agent orchestration pattern early. It's the difference between an agent and a system of agents.
❌ Ignoring the three-layer architecture
The book prescribes: (1) function calling, (2) MCP tool protocols, (3) A2A collaboration. Your agent needs all three layers. Many coding agents stop at layer 1. Don't build a one-layer agent and pretend it's production-ready.
❌ Skipping the iteration loop
The biggest mistake is building all patterns in sequence without testing and iterating. Build a pattern, test it with real agent tasks, fix what breaks, then move on. Use the book's adversarial testing pattern to proactively find weaknesses.
| Phase | Weeks | Focus | Deliverable |
|---|---|---|---|
| Phase 1 | 1–2 | Requirements Extraction | Structured requirements from the book's patterns |
| Phase 2 | 3–5 | Capability Implementation | 10+ tested pattern modules (orchestrator, RAG, retry, auth, etc.) |
| Phase 3 | 6–7 | Build the Coding Agent | Functional coding agent assembled from pattern modules |
| Phase 4 | 8+ | Iterate & Harden | Production-ready agent with fine-tuning and adversarial testing |
The big picture: 8+ weeks, ~8 hours per week (~64 hours total) gets you from zero to a working coding agent built on enterprise-grade agentic architectural patterns. Each pattern is a standalone, tested module that could be reused in future agent projects. You're not just building a coding agent — you're building a pattern library for agentic systems, derived from published research.