Subgoal Generation
Migrate this service to the new database is not something anyone does in one move, and an agent handed that sentence has nowhere to put its first tool call. Subgoal generation is the step where the agent invents the intermediate targets that make the goal reachable: dump the schema, map the column types, write the migration, run it against a copy, verify the row counts.
Targets, not instructions
It sits close to task decomposition, and the distinction is worth keeping. Decomposition splits work into pieces; a subgoal is a state the agent is trying to reach — the test suite passes on the new schema, rather than run the tests. Stated as conditions, subgoals are checkable, which is what lets the loop tell progress from motion. Good ones share three properties:
- Verifiable — the agent can observe whether the subgoal now holds.
- Ordered by dependency — later ones assume what earlier ones establish.
- Sized to a few steps — large enough to matter, small enough not to need a plan of its own.
When it goes wrong
Subgoals are produced by the same model that will pursue them, so they inherit its blind spots. Over-fine ones flood the context window with bookkeeping and spend the step budget on trivia. Over-coarse ones hide failure: set up the environment either succeeded or didn't, and the agent cannot tell which part. Worst is a subgoal satisfiable without advancing the real goal — the agent marks it complete and the task quietly stalls. Plan-and-Execute agents and frameworks like LangGraph hold the subgoal list as explicit state so it can be inspected, revised mid-run, and resumed after a crash.
Subgoal generation is the reasoning step in which an agent turns a broad goal into intermediate targets it can actually pursue — each stated as a checkable condition rather than an instruction, ordered by dependency and sized to a few steps. Subgoals give the loop something concrete to verify progress against. Without them, an agent handed an abstract objective has no basis for choosing its next action and cannot distinguish real advancement from activity.
Tell a builder to renovate the kitchen and nothing happens in the next five minutes. Tell them the first job is clearing out the old units, and work starts. A big instruction only becomes action once it is turned into smaller targets.
Subgoal generation is an AI agent doing that for itself. Given a broad aim, it writes its own list of milestones, then works towards them one at a time.
The useful part is that each milestone is something it can check: is the room clear, yes or no? That is how the agent knows it is genuinely getting somewhere rather than just keeping busy — and how it spots the moment a milestone refuses to budge and help is needed.