Build a Multi-Agent Research Team · 35 min · Python · Anthropic Python SDK · Pydantic
The Planner Agent
The Planner is the one agent whose only job is deciding what the other 4 should do -- get its output structured wrong and every downstream agent inherits the confusion.
Hiring signal: Task decomposition into structured, assignable sub-tasks is the actual hard part of any multi-agent system -- more than any individual specialist's prompt quality.
What you will learn
- Build an agent that decomposes a research question into structured sub-tasks
- Assign sub-tasks to specific specialist roles using structured output
- Understand why the Planner uses a stronger model than the specialists
Introduction
The state schema exists but every field is empty. Today's agent is the first one that actually runs: given a raw research question, it decides what the other 4 agents should each go do.
Structured task assignment, not a free-form plan
from pydantic import BaseModel
from typing import Literal
class TaskAssignment(BaseModel):
specialist: Literal["web_researcher", "technical_analyst", "market_analyst"]
sub_task: str
class TaskList(BaseModel):
research_question: str
tasks: list[TaskAssignment]
If you built Course 06's coding agent, this should feel familiar: a Pydantic schema, populated by prompting the model for JSON matching it, parsed and validated before anything downstream trusts it. The Literal["web_researcher", ...] type does real work here -- it constrains the model to only ever assign a sub-task to one of the 3 specialists that actually exist, rather than inventing a 4th role nothing in the graph knows how to route.
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers Why the Planner gets the stronger model, What You're Building — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy