Goals & Planning
A loop with no clear destination wanders forever. Give the agent a goal it can *check* it has reached — then let it plan toward it.
The loop from last lesson repeats until “the goal is met” — but that phrase is doing a lot of hidden work. Give an agent a vague goal like “make my trip better” and it wanders: it can’t tell when it’s done, so it flails or stops early. Give it a fuzzy multi-part goal with no plan and it forgets half of it. The single biggest lever on whether an agent succeeds isn’t the model — it’s how well you define the goal and let it plan. Hold the question: what makes a goal something an agent can actually finish?
A goal needs a checkable finish line
The loop keeps going “until the goal is met,” so the agent must be able to tell when it’s met. A good goal comes with a success criterion — a condition the agent (or your code) can check. “Make my trip better” has no finish line; “book a refundable hotel under $200/night within 1 mile of the venue for these dates” does. The clearer the criterion, the more reliably the agent stops at the right moment instead of quitting early or looping forever. This is the same “say exactly what you want” instinct from Module 2, now applied to a whole task rather than one reply.
Decompose big goals into steps
Most real goals are too big to hit in one action, so the agent must decompose them: break the goal into an ordered set of smaller sub-goals, each achievable with a tool call or two. Often you have the model do this explicitly — “first list the sub-tasks, then work them one by one” — which is just chain-of-thought (Module 2) applied to planning. Decomposition keeps a complex goal from collapsing into confusion: the agent always knows which small piece it’s on, and the running state (last lesson) tracks which pieces are done.
Turning a big goal into a plan: Goal: “organize a team lunch.” Decomposed → 1. find 3 restaurants near the office that seat 12, 2. check availability Friday 12–1, 3. pick the best-rated available option, 4. book it and send the team the details. Now each step is a concrete action with its own mini finish line, and “done” = step 4 confirmed.
Plan-then-act (and re-plan)
A common, robust pattern is plan-then-act: the agent first drafts a plan (the decomposition), then executes it step by step through the loop — but revises the plan whenever an observation demands it (recall: the loop reacts to reality). So it’s not “plan once, obey forever” (which we saw breaks); it’s “have a plan, but update it as you learn.” The plan gives direction and a way to measure progress; the loop keeps it honest. Together, a checkable goal + a living plan are what turn a wandering loop into an agent that actually finishes.
Think of sending someone to the grocery store. “Get some good stuff” (no goal, no list) and they come back with random items, or wander the aisles unsure when to leave. Hand them a list (the decomposed goal) with a clear finish — “these ten items, under $50” — and they know exactly what to do and when they’re done. And if an item’s out of stock, a good shopper doesn’t freeze or ignore it; they adjust the list on the fly (re-plan). A checkable goal plus a flexible list is the difference between a helper and a wanderer.
A fuzzy goal fixed: 1. Bad: “improve our onboarding.” The agent has no finish line, no steps — it does something vague and stops. 2. Better: “Draft a 5-step onboarding checklist for new hires, each step ≤ 2 sentences, saved as a numbered list.” Now there’s a checkable criterion (5 numbered steps, each ≤ 2 sentences). 3. The agent decomposes: brainstorm steps → trim to 5 → tighten wording → format → verify the criterion. 4. It knows precisely when it’s done, and you can check the result against the stated criterion. Same model, night-and-day reliability — because the goal was defined.
This is the reading. The interactive version — active-recall quiz, a hands-on experiment you run in your own AI, and an earned mastery check — is free in the app.
Start this lesson free →