These slides accompany my talk “Orchestrating AI Agents with Pattern Matching.” The presentation explores how pattern matching can be used to introduce deterministic control into systems built around inherently non-deterministic AI agents.
The first part introduces modern pattern-matching capabilities, including switch expressions, completeness requirements with sealed types, guarded patterns, record deconstruction, and unnamed variables and patterns.
The second part applies these concepts directly to AI-agent orchestration. The examples demonstrate several orchestration patterns: handling structured agent results, a Planner → Coder → Reviewer pipeline, branching delegation with a router, retry and feedback loops, and parallel fan-out with a judge agent.
The central idea is to keep AI agents probabilistic while making the orchestration layer explicit, typed, and predictable through pattern matching.
The slides also include the link to the accompanying code samples.