Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

Agent Foundations

Free · sign in to start and track progress

1 · What agents are

  • 1What is an agent?
  • 2Tools and the agent-computer interface
  • 3Context engineering

2 · Making agents dependable

  • 4Structured outputs and grounding
  • 5Workflow patterns

    Exercise answers

    • Answer: Build a chain with a code gate, then add routing
    • Answer: Orchestrator-workers and an evaluator loop with subagents
  • 6Risk and first evals
CapstoneA document review agent in Claude CodeReference implementation

Module 2 · Making agents dependable · Lesson 5

Workflow patterns

The five standard ways to compose model calls (chaining, routing, parallelisation, orchestrator-workers and evaluator-optimizer), when each one pays for itself, and how each maps onto a real workflow step in Claude Code, the Agent SDK and eve.

75 min 1 video 3 exercises 7-question quiz Answers
Setup for the exercises:Install Claude CodeNode.js, pnpm and TypeScript

By the end of this lesson you can

  • Describe the five workflow patterns and name the condition under which each one is worth its cost
  • Choose a pattern for a given workflow step and justify it against a simpler alternative
  • Implement a prompt chain with a code gate using Claude Code headless mode from TypeScript
  • Calculate the latency gain of sectioning and the error reduction of majority voting, and explain why correlated errors shrink the gain
  • Map orchestrator-workers and evaluator-optimizer onto subagents in Claude Code, the Agent SDK and eve

On this page

  • Patterns are about who decides the path
  • Prompt chaining
  • Routing
  • Parallelisation
  • Sectioning
  • Voting
  • Orchestrator-workers
  • Evaluator-optimizer
  • Choosing a pattern
  • Misconceptions and limits
  • Where this goes next
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01Patterns are about who decides the path
  2. 02Prompt chaining
  3. 03Routing
  4. 04Parallelisation
  5. 05Orchestrator-workers
  6. 06Evaluator-optimizer
  7. 07Choosing a pattern
  8. 08Misconceptions and limits
  9. 09Where this goes next
  10. 10Summary

Sources & further reading

  • Self-Refine: Iterative Refinement with Self-FeedbackPaper · Madaan et al. · 2023The research basis for evaluator-optimizer. A model drafts, critiques and revises its own output, improving by about 20 points (absolute) on average across seven tasks. Read the abstract and Figure 1.
  • Self-Consistency Improves Chain of Thought Reasoning in Language ModelsPaper · Wang et al. · Google Research · 2022The research basis for voting. Sample several reasoning paths and take the majority answer. Read the abstract and the introduction.
  • Building effective agentsLab research · Erik Schluntz and Barry Zhang · Anthropic · 2024The source of the five patterns used here. Read the "Workflow" sections, each with its "When to use this workflow" paragraph and examples. The post now says some of its tooling advice is dated; the patterns themselves are not.
  • Create custom subagentsDocs · AnthropicHow Claude Code subagents are defined in .claude/agents/, with their own prompt, tools and model. The building block for orchestrator-workers on your subscription.
  • Subagents in the SDKDocs · AnthropicThe same subagents defined programmatically through the agents option of query(). Read the first example and the section on detecting subagent invocation.
  • Claude cookbooks, agent patternsDocs · AnthropicMinimal reference implementations of chaining, routing, parallelisation, orchestrator-workers and evaluator-optimizer. Useful to compare with your own after the exercises.
Free · sign in to start

Sign in to keep reading.

Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

  • 10 more sections
  • 3 hands-on exercises
  • A 7-question quiz
  • Progress, quiz scores and bookmarks