Phase 14: Agent Engineering

Anthropic's Workflow Patterns: Simple Over Complex

Schluntz and Zhang (Anthropic, Dec 2024) distinguish workflows (predefined paths) from agents (dynamic tool-use). Five workflow patterns cover most cases. Start with direct API calls. Add agents only when steps cannot be predicted. Name Anthropic's five workflow patterns: prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer. Explain the agent-vs-workflow distinction and the engineering cost of each. Identify when to pick a workflow over an agent (and vice versa). Implement all five patterns in stdlib against a scripted LLM. Teams reach for multi-agent frameworks for problems that want a single function call. The cost is real: frameworks add layers that obscure prompts, hide control flow, and invite premature complexity. Schluntz and Zhang's Dec 2024 post is the most-cited industry pushback: start simple, add complexity only when it earns its cost. Workflow. LLMs and tools orchestrated through predefined code paths. Engineers own the graph. Agent. LLMs dynamically direct their own tools and take their own steps. The model owns the graph. Both have their place. Workflows are cheaper, faster, and easier to debug. Agents unlock open-ended problems but make failure modes harder to reason about. Foundation for all five patterns: one LLM with three capabilities wired in — search (retrieval), tools (actions), memory (persistence). Any API call can use these. Prompt chaining. Output of call 1 is input to call 2. Use when a…

Anthropic's Workflow Patterns: Simple Over Complex: Schluntz and Zhang (Anthropic, Dec 2024) distinguish workflows (predefined paths) from agents (dynamic…

This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.

Browse the complete course catalog or open this lesson on GitHub.