You are designing an agent that must migrate a legacy REST API to GraphQL. The agent will need to analyze the existing API, generate a schema, update resolvers, run tests, and open a pull request. Which approach best reflects proper task decomposition for this agent?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Think of task decomposition like building a house — you don't just say 'build it' and hand someone a hammer. You draw blueprints, pour foundation, frame walls, then wire electricity in sequence. Agents work the same way: discrete steps with clear handoffs prevent the model from skipping critical work or looping on ambiguity. The correct answer defines each step with explicit inputs and outputs, which is the foundation of reliable agent architecture.
Full explanation below image
Full Explanation
Proper task decomposition is one of the most critical design decisions in agentic AI systems. When an agent receives a complex, multi-phase task like a REST-to-GraphQL migration, breaking it into discrete ordered steps accomplishes several things: it creates checkpoints where outputs can be validated, it reduces the blast radius of any single step failing, and it allows human review at meaningful boundaries.
Option B is correct because it names five explicit steps — analyze, schema draft, resolvers, tests, PR — each of which produces an artifact that becomes the input for the next. This structure enables traceability, retry logic, and parallelization where appropriate.
Option A is a common anti-pattern called 'under-specified tasking.' When the agent decomposes steps at runtime without pre-defined structure, it may omit critical phases (like running tests before opening a PR), and the developer has no visibility into which steps were taken until the PR is already open.
Option C resembles 'free-range' agent behavior — all tools available with no sequencing constraints. This leads to race conditions, redundant actions, and difficult-to-debug traces. Tool availability should be scoped to each step, not globally available.
Option D reduces decomposition to the point where each 'step' is still ambiguous. 'Design' and 'implement' are not discrete enough to validate incrementally — a schema draft is meaningfully different from resolver implementation and should be its own artifact and checkpoint.
The exam objective is: 'Identify steps for agents to perform.' The best practice is to pre-define steps with explicit inputs, outputs, and success criteria before the agent runs — not inferred dynamically.