Week 2 · Foundations

Agent Workflows

Pick the right pattern

⏱ ~5 hours, hands-on🐍 Python / 🔷 TypeScript🛠 You ship: 13 workflow patterns you can run, watch and compare
▶ Open the slides
What this week is

Last week you built an agent. This week you learn when not to. Most production "AI features" are workflows: fixed steps where your code owns the control flow and the model fills in the blanks. They are cheaper, faster and far more predictable than an agent.

The one question that sorts every pattern: who decides the next step, your code or the model? Move that decision to the model and you gain flexibility — and pay for it in cost, latency and predictability. The skill is knowing when that trade is worth it.

We build thirteen patterns in plain Python, each one small enough to read in a minute, and run them side by side in a live visualizer that lights up every step, highlights the line that is running, and counts the model calls.

Then we close with evaluation: how to prove that the pattern you picked actually works, by judging the outcome and the trajectory, not just the final sentence.

The walkthrough

Each part adds one capability to the same growing codebase, and each is a runnable checkpoint.

  1. 01Agent fundamentalsTools, MCP and skills, RAG, context, memory, planning: the parts every agent is made of, in one map.
  2. 02Non-agent workflowsPrompt chaining, routing and parallelization. Your code owns the control flow; the model fills in the steps.
  3. 03Single-agent systemsReAct, plan-and-execute, reflection and CodeAct. The model picks the next step inside a loop you bound.
  4. 04Multi-agent systemsSequential agents, parallel agents, supervisor, dispatcher, evaluator-optimizer and peer-to-peer — and why you rarely need the last one.
  5. 05Choosing a patternCost, latency and predictability side by side. Start with the simplest thing that works and move up only when it does not.
  6. 06Evaluating agentsOutcome vs trajectory, pass@k vs pass^k, and a suite built from real failures.

After this week you can

  • Tell a workflow from an agent, and choose between them on purpose
  • Implement the common single- and multi-agent patterns from scratch
  • Compare patterns on cost, latency and reliability with real numbers