AutoGPT: Goal Decomposition
You give AutoGPT a goal and it just... goes. How does it decide what to do first?
Goal
Understand how AutoGPT decomposes goals into sub-tasks, execute them, and iterate, and learn to write goals that produce useful results
What You'll Need
⏱ Time: 20 minutes | 📋 Tasks:
- Docker Desktop installed and running
- An API key from OpenAI, Anthropic, or any OpenAI-compatible provider (DeepSeek, GLM, etc.)
- A terminal open in a project directory
The Agent That Plans Its Own Work
Hermes and Openclaw Fleet both expect us to define the sub-steps. We tell Hermes "search these files, read each one, summarize, write the result." We tell the fleet "Coder implements this, Reviewer audits that." The human is still doing the task breakdown.
AutoGPT works the other way. We give it a high-level goal — "Research renewable energy trends in Canada and compile a summary" — and AutoGPT figures out the sub-steps itself. It decides what to search for, what sources to check, how to organize the findings, and when it's done. We don't plan the work. We define the destination, and AutoGPT navigates the route.
This is both the superpower and the risk. AutoGPT can handle goals that are too vague or complex for us to break down in advance. But it can also go down rabbit holes we never intended, because its idea of "good enough" might not match ours.
How Goal Decomposition Works
Goal decomposition is the process of turning a single high-level objective into an ordered list of sub-tasks that, when executed in sequence, achieve the objective. AutoGPT does this in three stages:
| Stage | What happens | Example |
|---|---|---|
| 1. Brainstorm | Agent generates a list of all possible sub-tasks the goal might require | "Search for trends, find government reports, check news, compile into sections" |
| 2. Prioritize | Agent ranks sub-tasks by importance and dependency order | "Search first (provides raw material), then read, then organize, then write" |
| 3. Execute & re-prioritize | Agent works through the list, adjusting order and adding new sub-tasks as it learns | "Found a key report → add 'extract statistics from this report' to the list" |
The critical difference from a fixed task list: AutoGPT can add, remove, and reorder sub-tasks based on what it discovers during execution. If it searches for "renewable energy Canada trends" and finds a promising government PDF, it might add "download and analyze PDF" as a new sub-task on the fly. A fixed-plan agent wouldn't do that — it would stick to the original script and miss the PDF entirely.
The Agent Loop in Detail
AutoGPT's execution loop refines the basic perceive → decide → act pattern into five steps. Every cycle through this loop moves the agent closer to the goal:
- Perceive context — The agent reads its current state: what sub-tasks remain, what results came back from the last action, what the goal says. It has access to a "scratchpad" where it can store notes between cycles.
- Generate sub-tasks — Based on the perceived context, the agent generates a fresh list of sub-tasks. This happens every cycle, not just at the start. The previous list is reconsidered and revised each time.
- Select next action — The agent picks the single highest-priority sub-task to execute next. It considers dependencies: if "analyze PDF" depends on "download PDF," it won't skip ahead.
- Execute — The agent calls a tool (web search, file read, code execution, etc.) and captures the result.
- Evaluate result — The agent compares the result against its success criteria. Was the search productive? Did the PDF contain useful data? Should we adjust the approach? The evaluation feeds back into the next cycle's context.
This loop runs until the agent decides the goal is met, or it hits a safety limit (max iterations, max cost, or a human interrupt). Because the loop regenerates the task list every cycle, it can adapt to surprises — a broken link, an unexpectedly rich source, a rabbit hole that needs to be cut off.
Walkthrough: Research with AutoGPT
Let's run AutoGPT with a real research goal and watch it decompose the work.
Step 1: Install and configure
Pull the AutoGPT Docker image and create a directory for your work:
docker pull significantgravitas/auto-gpt mkdir autogpt-work cd autogpt-work
Step 2: Define the goal
Create a goal file called goal.yaml:
# goal.yaml
goal: "Research renewable energy trends in Canada for 2025-2026.
Focus on solar, wind, and hydro. Check government reports,
industry news, and academic sources. Compile findings into
a markdown report with sections per energy type, key statistics,
growth trends, and notable projects. Save to canada-renewable-energy.md."
constraints:
- "Only use sources published after January 2024"
- "Prefer Canadian government sources (.gc.ca) where available"
- "Do not use Wikipedia as a primary source"
- "Max 10 iterations"
resources:
- "web_search"
- "browse_website"Step 3: Run it
Start AutoGPT with the goal file:
docker run -it \ -v $(pwd):/app \ -e OPENAI_API_KEY=$OPENAI_API_KEY \ significantgravitas/auto-gpt \ --goal-file /app/goal.yaml
Step 4: Watch the task list evolve
AutoGPT will print its current task list at the start and update it as it works. Watch how it evolves across iterations:
┌─ Iteration 1 ───────────────────────────┐ │ Current task list: │ │ 1. Search for Canadian renewable energy │ │ 2. Find government reports on solar │ │ 3. Find government reports on wind │ │ 4. Find government reports on hydro │ │ 5. Check industry news sources │ │ 6. Compile findings into report │ │ Executing: Search for Canadian renewable │ │ Result: Found NRCan 2025 outlook page... │ └──────────────────────────────────────────┘ ┌─ Iteration 3 ───────────────────────────┐ │ Current task list: │ │ 1. Browse NRCan energy outlook │ │ 2. Extract solar statistics │ │ 3. [NEW] Check CanREA 2025 market report │ │ 4. Find government reports on wind │ │ 5. Find government reports on hydro │ │ Executing: Browse NRCan energy outlook │ │ Result: Page contains 2025 solar data... │ └──────────────────────────────────────────┘
Notice how iteration 3 added a new sub-task ("Check CanREA 2025 market report") that wasn't in the original list. The agent found a reference to the Canadian Renewable Energy Association and decided the report was worth checking. A fixed-plan agent would have missed it.
Key insight: The task list is never final. AutoGPT treats it as a hypothesis — "these are the steps I think I need" — that gets revised every cycle. This is what makes it good at open-ended research and what makes it unpredictable for precise operations.
AutoGPT vs Hermes vs Openclaw
Each tool takes a different approach to task planning:
| Dimension | AutoGPT | Hermes | Openclaw Fleet |
|---|---|---|---|
| Task planning | Agent decomposes goal autonomously | You define the task list upfront | You define roles and workflows; agents handle execution |
| Autonomy level | Highest — decides what to do and when to stop | Medium — follows your plan but executes autonomously | Medium-high — works autonomously within role boundaries |
| Controllability | Low — can go in unexpected directions | High — you control the steps, agent controls execution | Medium — roles constrain scope, but within-role decisions are autonomous |
| Best for | Open-ended research, discovery, creative exploration | Well-defined multi-step tasks, prototyping | Production pipelines, multi-agent coordination, sensitive work |
| Worst for | Precise operations, tasks requiring strict adherence to process | Goals that are too vague for you to break down | Simple one-shot tasks that don't need a team |
AutoGPT is the most autonomous option in this track. That's its strength for research and its weakness for anything that needs a repeatable, predictable process. Use it when the goal is clear but the path isn't — that's exactly the gap goal decomposition is designed to bridge.
Deliverable: Goal-Writing Template
A well-formed goal is the difference between AutoGPT producing a useful result and going on an expensive tangent. Here's a template that works:
# goal-template.yaml # Use this template for every AutoGPT goal goal: | [What success looks like — be concrete] Example: "Research renewable energy trends in Canada and compile a summary report with sections per energy type and key statistics." constraints: - [What to avoid — boundaries that keep the agent focused] - "Only use sources from 2024 or later" - "Do not use Wikipedia as a primary source" - "Max [N] iterations" resources: # Tools the agent is allowed to use - "web_search" - "browse_website" # Optional: set a cost limit limits: max_cost: 1.00
Every goal should answer three questions:
- What does success look like? — Not just "research X" but "a markdown file with sections for each subtopic, at least 3 sources per section, saved to this path." The more concrete, the less room for the agent to wander.
- What tools are available? — Make the allowed tools explicit. If the agent doesn't need file write access, don't give it to them. Each tool is a potential rabbit hole.
- What should we avoid? — Surface constraints upfront: "Don't use Wikipedia," "Don't spend more than $1.00," "Max 15 iterations." Boundaries are the safety net for autonomous goal decomposition.
Try It
Run the renewable energy research goal from the walkthrough. Watch the task list evolve across iterations. After it finishes (or hits its limit), open the generated report and evaluate: How complete is it? Did it go in directions you didn't expect? Would you trust the sources it used?
Then write a goal for something you need researched. Run it through the goal-writing template first, refine the constraints, and let AutoGPT work. Compare the output from AutoGPT with what you'd get from searching manually. The goal decomposition pattern means you can set the direction and let the agent handle the navigation — but only if the goal is well-formed enough to keep it on course.
Next lesson: Comparing the Options — a decision framework for choosing between Hermes, Openclaw, and AutoGPT across autonomy, safety, setup effort, and scalability.