This article presents practical patterns for building effective agentic systems with large language models (LLMs), drawn from Anthropic's guidance and production experience across dozens of teams and industries. The most successful implementations did not rely on complex frameworks or specialized libraries, but on simple, composable patterns. The core guidance: success is not about the most sophisticated system but the right system for your needs — start with simple prompts, optimize them with comprehensive evaluation, and add multi-step agentic systems only when simpler solutions fall short.
It distinguishes between workflows (predefined code paths orchestrating LLM calls) and agents (systems where LLMs dynamically direct their own processes). The core building block is the augmented LLM (with retrieval, tools, and memory) and the Model Context Protocol (MCP) is one route to augmenting it. Several reusable workflow patterns are described — prompt chaining, routing, parallelization, orchestrator-workers, and evaluator-optimizer — along with guidance on when each is appropriate. The article also discusses when to use (and not use) agents and frameworks, and includes two appendices: "Agents in Practice" (customer support and coding agents) and "Prompt engineering your tools."
(Note added later: much of the tooling landscape described has changed since December 2024; the current approach is covered in "how we built Claude Managed Agents" and the Managed Agents documentation.)
Definitions. "Agent" is defined variously across teams: some mean fully autonomous systems operating independently over extended periods with various tools to accomplish complex tasks; others mean more prescriptive implementations following predefined workflows. Anthropic's architectural distinction is workflows versus agents.
Every agentic system begins with an LLM that can actively use augmentations — retrieval (search queries), tool selection, and memory. Implementations should carefully tailor these capabilities to the use case and expose a well-documented interface. The Model Context Protocol (MCP) is one approach to integrate a growing ecosystem of third-party tools with a simple client. All subsequent workflow patterns assume each LLM call has access to these augmentations.
A task is broken into fixed steps; each step's output becomes the next step's input. Programmatic checks can validate intermediate results (e.g., an outline must meet criteria before generating the full document).
Use when: the task can be cleanly decomposed into fixed subtasks and higher accuracy justifies the latency of multiple calls — each call becomes easier.
Examples: generating marketing copy then translating it; writing a document outline, verifying it, then writing the full text.
An LLM (or traditional classifier) categorizes an input and routes it to a specialized handler (different prompt, toolset, or model), separating concerns so that optimizing for one input type does not degrade others. Classification can be done by an LLM or a more traditional classification model/algorithm.
Use when: there are distinct categories that benefit from separate handling and classification is accurate.
Examples: customer service queries split by type (general, refund, support); using a cheaper model for common questions and a capable model for complex ones — e.g., routing easy/common questions to smaller cost-efficient models like Claude Haiku 4.5 and hard/unusual questions to more capable models like Claude Sonnet 4.5.
Two variations:
A central orchestrator LLM decides how to break a task into subtasks, delegates them to worker LLMs, and synthesizes their outputs. Unlike parallelization, subtasks are not pre-defined but dynamically determined per input.
Use when: you cannot predict the subtasks in advance (e.g., coding tasks where the number and nature of file changes depend on the request).
Examples: coding assistants that modify multiple files in one session; complex search that gathers and cross-references information from many sources.
One LLM generates a response; a second LLM evaluates it and provides feedback, enabling iterative improvement in a loop. The evaluator may decide whether further iterations are needed.
Use when: clear evaluation criteria exist and iterative refinement demonstrably improves output (like human editing).
Examples: literary translation where the evaluator catches nuance; complex search tasks needing multiple rounds of querying and analysis.
An agent is an LLM that, after an initial command or discussion with a user, plans and operates autonomously. It iteratively uses tools, observes results (ground truth from the environment), and decides next steps. Human feedback can be requested at checkpoints. Stopping conditions (e.g., max iterations) maintain control.
Implementation is typically simple — an LLM using tools in a loop. Success depends on carefully designing the toolset and tool documentation.
When to use: tasks that require flexibility, multi-step reasoning, and tool use where the exact path cannot be predetermined.
Examples: open-ended research assistants, multi-file coding agents, complex data analysis pipelines, and a "computer use" reference implementation where Claude uses a computer to accomplish tasks.
Start simple: often a single LLM call with retrieval and in-context examples is sufficient. Workflows add predictability and consistency for well-defined tasks; agents add flexibility and model-driven decision-making for dynamic tasks. If the task does not benefit from model-driven decision-making, avoid agents. Examples cited for the patterns include a coding agent that resolves SWE-bench tasks (edits to many files based on a task description).
Frameworks that ease implementation include the Claude Agent SDK; Strands Agents SDK by AWS; Rivet, a drag-and-drop GUI LLM workflow builder; and Vellum, another GUI tool for building and testing complex workflows. They simplify low-level tasks — calling LLMs, defining and parsing tools, chaining calls — but their abstraction layers often obscure the underlying prompts and responses, making debugging harder, and they tempt developers toward complexity when a simpler setup would suffice. Recommendation: start with LLM APIs directly, since many patterns take only a few lines of code; if you do use a framework, understand the underlying code, because incorrect assumptions about what's under the hood are a common source of customer error. Sample implementations are in the cookbook (patterns-agents-basic-workflows).
These building blocks aren’t prescriptive. They are common patterns that developers can shape and combine to fit different use cases. Success depends on measuring performance and iterating on implementations. Add complexity only when it demonstrably improves outcomes.
When implementing agents, follow these three principles:
Frameworks can help you start quickly, but as you move to production, reduce abstraction layers and build with basic components. These principles create agents that are powerful, reliable, maintainable, and trusted.
Two particularly promising applications demonstrate the practical value of the patterns above. Both require conversation and action, have clear success criteria, enable feedback loops, and integrate meaningful human oversight.
Customer support combines familiar chatbot interfaces with tool integration. It is a natural fit for open‑ended agents because:
Several companies have validated this approach through usage‑based pricing models that charge only for successful resolutions, showing confidence in their agents' effectiveness.
Code agents have evolved from completion to autonomous problem‑solving. They are effective because:
In Anthropic’s own implementation, agents solve real GitHub issues in the SWE‑bench Verified benchmark based solely on the pull request description. Automated testing helps verify functionality, but human review remains crucial for ensuring solutions align with broader system requirements.

Tools enable Claude to interact with external services and APIs by specifying their exact structure and definition in the API; when Claude plans to invoke a tool, its response includes a tool use block. Tool definitions and specifications deserve as much prompt engineering attention as your overall prompts.
Several ways exist to specify the same action (e.g., writing a diff vs. rewriting the entire file; returning code in markdown vs. JSON). Such differences are cosmetic and losslessly convertible, but some formats are much harder for an LLM to produce — writing a diff requires knowing how many lines are changing in the chunk header before writing the new code, and writing code inside JSON (versus markdown) requires extra escaping of newlines and quotes. Suggestions:
Invest as much effort in ACI as in human‑computer interfaces (HCI). Recommendations:
For example, while building the SWE‑bench agent, Anthropic spent more time optimizing tools than the overall prompt. The model made mistakes with relative filepaths after moving out of the root directory. Changing the tool to always require absolute filepaths eliminated the errors.
Acknowledgements: written by Erik S. and Barry Zhang, drawing on Anthropic's experience building agents and customer insights.
See also: 存算分离架构, Poke (AI assistant), Poke notification triage, HTML-first workflows with Claude Code, Software Engineering Beyond Coding, Claude Design, Dai Yusen's AI Investment and Ecosystem Analysis, yopedia, RLM Agents, Open Knowledge Format, The Log Is the Agent, Agent Harness, , , , , , , , , , , , , , , , , , , ,
Sources · 1