Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
This is an old revision of the document!
Modular architectures for AI agents organize system components into discrete, interchangeable modules such as planning, memory, tool use, and perception layers. This separation of concerns allows developers to independently upgrade, test, and swap individual components without rebuilding the entire agent. By 2025-2026, modular design has become the dominant paradigm for production agent systems, supported by standardized protocols like MCP and A2A that enable interoperability across vendors and frameworks.
Modular agent architectures follow several core principles:
The typical progression is: single agent with tools (prototyping) to structured workflows (production) to multi-agent orchestration (enterprise scale).
The simplest modular pattern: a central LLM augmented by 10-20 external functions for search, code execution, data retrieval, and other tool-use capabilities. Quick to build and debug, but scales poorly beyond the tool limit due to context constraints and tool selection errors.
Directed graphs of specialized processing steps, where each node performs a specific function (generate, evaluate, refine). Unlike free-form agent loops, workflows follow predetermined paths with conditional branching. Suitable for predictable multi-step tasks like content pipelines, data processing, and approval workflows.
Multiple specialized agents collaborate on complex tasks:
Research shows that compiling multi-agent systems into single agents with skills (reusable capability modules) can reduce token usage by 54% and latency by 50% while matching accuracy, suggesting that the overhead of inter-agent communication is often unnecessary.
LangGraph (LangChain) provides graph-based workflow composition with StateGraph nodes for agents, tools, and decision points; conditional edges for dynamic routing based on state; explicit human-in-the-loop nodes for enterprise oversight; shared state management across graph traversals; and 4.2M+ downloads with strong enterprise adoption.
CrewAI focuses on role-based multi-agent collaboration with agents having defined roles, goals, and tool access; sequential and parallel task execution within crews; built-in delegation between agents; and good production readiness with moderate learning curve.
Microsoft AutoGen enables conversational multi-agent systems where agents interact through message passing; supports dynamic orchestration and peer handoffs; built-in human-in-the-loop modes (ALWAYS, TERMINATE, NEVER); best for exploratory multi-agent collaboration.
OpenAI Agents SDK provides a minimal but production-focused approach with agents, tools, and handoffs as core primitives; built-in tracing and observability; provider-agnostic design despite OpenAI branding; native tools including web search, file search, and computer use.
Three protocols have emerged as the interoperability stack for modular agents in 2025-2026:
Anthropic's Model Context Protocol for connecting agents to tools and data sources. MCP provides standardized tool discovery, universal connectivity (replacing custom integrations), and context sharing across systems. Adopted by OpenAI (March 2025), Google (April 2025), and donated to the Linux Foundation (December 2025). By early 2026: 97 million monthly SDK downloads, 5,800+ available servers.
Agent-to-Agent protocol facilitating collaboration between agents across different systems and vendors. Complementary to MCP – while MCP connects agents to tools, A2A connects agents to each other, enabling cross-organizational agent ecosystems.
Agent-User Interface protocol for standardizing how agents communicate with humans – feedback collection, approval workflows, and status reporting. Completes the protocol stack alongside MCP (agent-to-tool) and A2A (agent-to-agent).
Modular architectures often expose plugin interfaces for extending capabilities:
The trend toward composable agents treats agent capabilities as building blocks:
from abc import ABC, abstractmethod class Module(ABC): @abstractmethod def run(self, context: dict) -> dict: pass class PlannerModule(Module): def run(self, context: dict) -> dict: goal = context["goal"] steps = [f"Research {goal}", f"Analyze findings for {goal}", f"Summarize results"] return {"plan": steps} class MemoryModule(Module): def __init__(self): self.store = [] def run(self, context: dict) -> dict: if "save" in context: self.store.append(context["save"]) query = context.get("query", "") relevant = [m for m in self.store if query.lower() in m.lower()] return {"memories": relevant} class ToolModule(Module): def __init__(self, tools: dict): self.tools = tools def run(self, context: dict) -> dict: tool_name = context.get("tool") if tool_name in self.tools: return {"result": self.tools[tool_name](context.get("input", ""))} return {"error": f"Tool '{tool_name}' not found"} class ModularAgent: def __init__(self): self.modules: dict[str, Module] = {} def register(self, name: str, module: Module): self.modules[name] = module def execute(self, module_name: str, context: dict) -> dict: return self.modules[module_name].run(context) agent = ModularAgent() agent.register("planner", PlannerModule()) agent.register("memory", MemoryModule()) agent.register("tools", ToolModule({"search": lambda q: f"Results for: {q}"})) plan = agent.execute("planner", {"goal": "climate change impacts"}) print("Plan:", plan["plan"]) agent.execute("memory", {"save": "User prefers concise answers", "query": ""}) memories = agent.execute("memory", {"query": "concise"}) print("Memories:", memories["memories"]) result = agent.execute("tools", {"tool": "search", "input": plan["plan"][0]}) print("Tool result:", result["result"])