Loading lesson...
Loading lesson...

Real-world milestone · March 2024
In March 2024, Cognition Labs announced Devin, described as the first AI software engineer. The launch demos showed Devin autonomously planning a coding task, writing code across multiple files, running tests, debugging failures, and deploying the result. The videos were compelling: an AI that could handle the full development lifecycle without human intervention.
Then independent evaluation arrived. On the SWE-bench benchmark, which measures the ability to resolve real GitHub issues from open-source projects, Devin scored 13.86% on the verified subset. Subsequent open-source agents achieved similar or better scores at a fraction of the cost. The gap between curated demos and systematic benchmarks revealed a pattern that applies to all AI agents: impressive on narrow tasks, fragile on the distribution of real-world problems.
This module examines how AI agents work, what makes them useful, and where the boundaries of current capability lie. A dedicated AI Agents course covers agent architecture in depth; this module provides the strategic overview needed to make informed adoption decisions.
Devin demonstrated impressive demos but scored 13.86% on real software engineering benchmarks. What does this gap between demos and benchmarks reveal about how we should evaluate AI agents?
With the learning outcomes established, this module begins by examining what makes something an agent in depth.
An AI agent is a system that uses a language model to decide what actions to take, executes those actions, observes the results, and iterates until a goal is achieved. The key distinction from a simple LLM call is the loop: an agent reasons about what to do next based on what has happened so far, rather than producing a single response.
This loop creates both the power and the risk of agents. The power is autonomy: an agent can break a complex task into steps, use tools to gather information, and adapt its approach when something fails. The risk is compounding errors: each step in the loop can introduce mistakes that propagate through subsequent steps, and the agent may not recognise when it has gone off track.
“An agent is a system that uses an LLM to decide the control flow of an application. Rather than hardcoding a sequence of steps, the LLM dynamically determines which actions to take and in what order.”
Anthropic, Building Effective Agents (2024) - Introduction, defining agents
Anthropic's definition emphasises that agency is about dynamic control flow, not just intelligence. A chatbot that always follows the same conversation template is not an agent. A system that decides whether to search, calculate, or ask for clarification based on the current state is.
With an understanding of what makes something an agent in place, the discussion can now turn to the react pattern, which builds directly on these foundations.
The ReAct (Reason + Act) pattern, introduced by Yao et al. in 2022, interleaves reasoning traces with actions. At each step, the model produces a Thought (explaining its reasoning), an Action (a tool call or API request), and an Observation (the result of that action). The next thought incorporates the observation, creating a grounded reasoning chain.
ReAct outperforms pure chain-of-thought prompting on tasks requiring external information because the reasoning is anchored to real data rather than the model's training distribution. When a ReAct agent needs to know today's weather, it calls a weather API rather than guessing from training data. When it needs to verify a fact, it searches rather than hallucinating.
The limitation is that ReAct agents are only as good as their available tools. An agent with access to a calculator, a web search API, and a code interpreter can solve problems that require all three. An agent with only web search cannot reliably perform calculations, no matter how sophisticated its reasoning.
Common misconception
“AI agents are autonomous and don't need human oversight.”
Current AI agents require human-in-the-loop for high-stakes decisions. The ReAct pattern improves grounding but does not eliminate errors: agents can misinterpret observations, choose wrong tools, or pursue dead-end reasoning paths. Production agent systems include approval gates for destructive actions (deleting data, sending emails, making purchases) and circuit breakers that halt execution after repeated failures. Fully autonomous agents are appropriate only for low-risk, reversible tasks.
With an understanding of the react pattern in place, the discussion can now turn to function calling and tool use, which builds directly on these foundations.
Function calling is the mechanism that enables LLMs to use structured tools. Instead of generating free-text that a parser must interpret, the model outputs a structured JSON object specifying which function to call and with what arguments. The runtime executes the function and returns the result to the model as a new message.
The quality of an agent depends heavily on schema design. Each tool must have a clear name, a precise description of what it does and when to use it, well-typed parameters with descriptions, and explicit error formats. Ambiguous tool descriptions cause the model to select the wrong tool; missing parameter descriptions cause it to pass incorrect arguments.
The Model Context Protocol (MCP), an open standard for connecting AI models to external tools, standardises this interface. MCP defines a client-server architecture where the model (client) discovers available tools, reads their schemas, and invokes them through a consistent protocol. This means a single agent can use tools from multiple providers without custom integration code for each one.
“MCP provides a standardised way for AI models to discover and use tools, resources, and prompts from external servers. It follows a client-server architecture where the host application connects to multiple servers.”
Model Context Protocol Specification (2024) - Architecture overview
MCP solves the N×M integration problem: without a standard protocol, N models connecting to M tools requires N×M custom integrations. With MCP, each model implements one client and each tool implements one server. This is the same architectural pattern that made HTTP successful for web communication.
With an understanding of function calling and tool use in place, the discussion can now turn to multi-agent systems, which builds directly on these foundations.
Multi-agent systems use multiple specialised agents that communicate and coordinate to solve problems that exceed the capability of any single agent. A coding agent might work alongside a testing agent and a deployment agent, each with its own tools and system prompt.
The key design decision is orchestration: how do agents communicate, who decides what happens next, and how are conflicts resolved? Two patterns dominate. Orchestrator-worker uses a central agent that decomposes tasks and delegates to specialised workers. This is simpler to debug but creates a single point of failure. Peer-to-peer allows agents to communicate directly, enabling more flexible collaboration but making the system harder to reason about.
Multi-agent complexity is justified only when the task genuinely requires different capabilities that cannot be provided through tools alone. A single agent with a code interpreter, a web browser, and a file system can handle most tasks. Adding a second agent is warranted when the task requires fundamentally different reasoning strategies (e.g., adversarial red-teaming alongside cooperative problem-solving) or when the context window of a single agent cannot hold all necessary information.
Common misconception
“More agents means better results. A team of 5 AI agents will outperform 1.”
Multi-agent systems introduce coordination overhead, message-passing latency, and failure modes that don't exist in single-agent systems. Each additional agent increases cost (more LLM calls), latency (sequential handoffs), and debugging complexity (distributed state). The Anthropic Building Effective Agents guide explicitly recommends starting with the simplest architecture that works: 'Don't build a multi-agent system when a single agent with good tools will do.'
A product team is building an AI customer support agent. The agent needs to look up order status, check refund policies, and sometimes escalate to a human. A developer proposes using 3 specialised agents: one for order lookup, one for policy questions, and one for escalation. Evaluate this architecture.
A ReAct agent is asked to calculate the compound interest on a savings account. It performs a web search for 'compound interest formula', finds the formula, then attempts to calculate the result by generating the arithmetic in natural language. The answer is wrong. What went wrong?
A startup is evaluating whether to build their own agent framework or use the Model Context Protocol (MCP) for tool integration. They need to connect to 8 different APIs. What is the primary architectural advantage of MCP?
You now understand how AI agents work and when multi-agent orchestration is justified. The next module asks a fundamentally different question: how do you teach an AI system to learn from its own experience through reward signals rather than labelled data? Module 21 covers reinforcement learning, the paradigm that produced AlphaGo, RLHF, and the alignment techniques that shape modern LLM behaviour.
Yao, S. et al., 'ReAct: Synergizing Reasoning and Acting in Language Models' (2022)
Full paper, arXiv:2210.03629
Introduces the ReAct pattern. Cited in Section 20.2 for the Thought-Action-Observation loop.
Anthropic, 'Building Effective Agents' (2024)
Full guide
Practical guidance on agent architecture, tool design, and when to use multi-agent systems. Cited in Sections 20.1 and 20.4.
Model Context Protocol Specification
Architecture overview
Open standard for AI-tool integration. Cited in Section 20.3 for the client-server architecture.
Jimenez, C. et al., 'SWE-bench: Can Language Models Resolve Real-World GitHub Issues?' (2024)
Results, verified subset
Benchmark for evaluating AI coding agents. Cited in the opening story for Devin's 13.86% score.
OpenAI, 'Function Calling' documentation (2024)
API reference, function calling
Reference implementation for structured tool use via function calling. Cited in Section 20.3.
Module 20 of 24 · AI Practice & Strategy