The Plan-Then-Act Loop
plan-then-act architecture
Part of: Multi-Step Task Agent
A chatbot answers one turn at a time. A multi-step task agent works differently. You hand it a goal like "research three competitors and write a comparison table," and it has to work out what steps that takes , run them in order, and stop once the work is actually finished. This lesson builds the shape everything else hangs on: plan, then act . What we're building By lesson 8 you'll have a working agent. You give it a goal, it produces an ordered plan, runs each step with the right tool, carries results forward, and stops on its own. Four moving parts hold it together: plan, execute, track state, stop. This lesson covers the first one, getting the model to turn a goal into a plan you can actually run. Plan up front, don't improvise A naive "agent" asks the model "what should I do next?" one step at a time, with no view of the whole task. It drifts. It redoes work it already did and loses track of the goal. A plan-then-act agent asks the model up front to break the goal into an ordered list of steps, before it touches a single tool. Only then does it work through that plan step by step. That plan is now a list of dicts like {"step": 1, "tool": "search", "instruction": "..."}. It is
Challenge: Validate a Plan's Step Order and Tools