Loop Engineering, Chapter 3: Choosing the Right Orchestration Framework
This is Part 3 of a series walking through my book Loop Engineering: Scaling and Governing Agentic AI. In the previous chapter, we laid out the six primitives. This one is about the layer that coordinates them.
Once a system has more than one agent and more than a couple of steps, something has to decide who runs when, what state they share, and how control flows between them. That is orchestration, and it is a genuinely separate concern from the reasoning the model does inside any single step. The good news is that you do not have to build it from scratch. The complication is that the three popular frameworks — LangGraph, AutoGen, and CrewAI — are not interchangeable, and choosing the wrong one means fighting the tool for the life of the project.
LangGraph treats a workflow as an explicit graph of nodes and edges over a typed state object. Its native idiom is the state machine: first-class cycles, conditional routing, and a checkpointed state you can inspect and replay. It is the right choice when you need determinism, traceability, and conditional branching — when you want to know exactly why the system did what it did. AutoGen takes the opposite stance. State is the running chat history, and routing happens through LLM-driven speaker selection. Its strength is emergent, conversational collaboration — agents that debate, negotiate, and surprise you — which is exactly what you want for open-ended problems and exactly what you do not want when you need a predictable path.
CrewAI sits between them, built for structured, role-based pipelines. You define agents with roles and backstories and hand them a sequence of tasks; work flows from one to the next in a clean, legible line. It is fast to stand up and easy to reason about, with the trade-off that it lacks the native cyclic iteration that LangGraph makes first-class.
The Diagram Test
The chapter's practical core is a test I keep coming back to. Before you choose a framework, draw your workflow on a whiteboard. If what you draw is a flowchart with branches and loops, you want the framework whose native model is a graph. If it is a conversation among peers, you want the one whose native model is a chat. If it is a job board where work passes down a line, you want the one whose native model is a pipeline. The mistake is to pick a framework first and then bend your problem to fit its shape.
The chapter walks each framework's defining idiom in code — a typed StateGraph with a conditional fixer loop, a group-chat speaker-selection sketch, a role-and-task pipeline — and lays out the honest trade-offs across state, routing, cyclic support, and how hard each is to debug when it misbehaves.
Tomorrow: a framework running on your laptop is still a laptop loop. Chapter 4 is about what changes when you move to real operations — and why it is not the same as MLOps.
📖 Get the book
The full chapter — runnable idioms for all three frameworks, the Diagram Test worked through, and a decision procedure across five axes — in one place.
Sho Shimoda
I share and organize what I’ve learned and experienced.Categories
Tags
Search Logs
Development & Technical Consulting
Working on a new product or exploring a technical idea? We help teams with system design, architecture reviews, requirements definition, proof-of-concept development, and full implementation. Whether you need a quick technical assessment or end-to-end support, feel free to reach out.
Contact Us