In Lesson 6.1, we connected two agents using Python. Each agent performed a different task, but the information passed between them was unrestricted text.
Now we’ll extend our Research Agent into a team of specialists, each with a defined responsibility and a structured output contract.
Why Specialize Agents?
Our Research Agent has been responsible for several activities: discovering sources, evaluating evidence, and preparing findings.
We could continue using one agent for all these tasks. But specialization offers another approach.
Instead of asking one agent to follow instructions for every stage of research, we can create separate agents with narrower responsibilities.
For our research workflow, we’ll introduce three specialists:
- Discovery Agent: Identifies relevant research sources and their claims.
- Evidence Agent: Assesses supporting evidence and limitations.
- Synthesis Agent: Combines evaluated findings into a research summary.
Specialization can make instructions more focused, improve the visibility of intermediate results, and allow us to test different stages independently.
It also introduces costs. More agents can mean additional model calls, longer execution times, and more opportunities for information to be lost between stages.
Multiple agents are useful when the responsibilities are meaningfully different, not simply because a task has several steps.
Defining Agent Responsibilities
Each specialist needs a clear boundary.
The Discovery Agent identifies candidate sources and extracts relevant claims. It should not decide whether those claims are reliable.
The Evidence Agent examines those claims, supporting information, and limitations. It should distinguish what the material reports from what can reasonably be concluded.
The Synthesis Agent prepares a summary using the evaluated evidence. It should preserve uncertainty rather than produce stronger conclusions than the evidence supports.
These boundaries are primarily established through each agent’s instructions, available tools, and input/output contracts.
An important distinction: defining a specialist does not automatically give it the capabilities required for its role. For example, a Discovery Agent without a search tool cannot independently discover current external sources.
Structured Output Contracts
You first used this mechanism in Lesson 5.3, where output_type=ProposedFinding shaped one agent’s answer. Here, the same mechanism defines the structured results that specialist agents pass to one another.
In Lesson 6.1, the Source Analysis Agent returned plain text.
The application then passed that text to another agent without knowing whether the response contained the expected information.
A structured output contract improves this interaction.
For example, instead of returning an arbitrary paragraph, the Evidence Agent can be required to return fields such as:
class EvidenceResult(BaseModel):
claim: str
supporting_evidence: list[str]
limitations: list[str]
assessment: str
Using Pydantic, we define the expected data structure in Python. The OpenAI Agents SDK supports structured agent outputs through its output_type configuration.
The result can be accessed as a Python object rather than interpreted as an unrestricted string.
This gives the orchestrator a more predictable interface between agents.
However, schema validation is not evidence validation.
A result can contain all the required fields while still being factually incorrect, misleading, or poorly supported.
We’ll examine these quality and failure considerations further in Lesson 6.4.
Delegation and Execution Control
In our first implementation, Python still determines which specialist runs next.

The workflow follows this sequence:
- Python sends prepared research material to the Discovery Agent.
- The Discovery Agent returns structured source information.
- Python passes that information to the Evidence Agent.
- The Evidence Agent returns a structured assessment.
- Python passes the assessment to the Synthesis Agent.
- The Synthesis Agent returns a structured summary.
Although work is divided among specialists, no agent autonomously delegates to another.
This is an important distinction between assigning specialized work and model-driven delegation.
In Lesson 6.3, we’ll introduce a Coordinator Agent capable of selecting specialists through the Agents SDK. We’ll compare that approach with the explicit sequence we’re using here.
Hands-on Lab 6.2: Three Specialized Research Agents
We’ll extend the previous exercise using the same OpenAI Agents SDK.
Exercise file: lab6_2_specialized_agents.py
This lab introduces three changes:
- Three independently configured agents instead of two.
- Pydantic models defining their expected outputs.
- Explicit transfer of structured data between agent runs.
We’ll continue using prepared research notes, so we can focus on specialization and contracts rather than live search and MCP integration.
The essential agent configuration looks like this:
evidence_agent = Agent(
name="Evidence Agent",
instructions="Evaluate the supplied source claims...",
output_type=EvidenceResult,
)
The output_type specifies the contract for the agent’s final result.
The orchestrator can then access the returned fields:
evidence = evidence_result.final_output
print(evidence.claim)
print(evidence.limitations)
In the complete exercise, Python passes serialized structured results between the agents.
Run the Exercise
With the virtual environment from Lesson 6.1 active:
python lab6_2_specialized_agents.py
The exercise makes live model calls and may incur API charges.
What to Observe
First, inspect the three specialist definitions. Each has its own instructions and output model.
Next, observe the structured result returned by each agent. Instead of producing unrestricted text, the agents return defined fields that Python can inspect and pass to the next step.
In our test run, the Evidence Agent returned a claim, supporting evidence, limitations, and an overall assessment. Importantly, it did not overstate the findings. It correctly described the evidence as weak and preliminary, noting the lack of a control group, limited sample size, and missing quality measurements.
The Synthesis Agent then transformed that structured assessment into a concise summary while preserving the remaining uncertainties.
The important architectural observation is that Python still controls the sequence. The agents do not decide when another specialist should run. The orchestrator determines the order and passes the structured results forward.
What This Example Does Not Yet Handle
The Discovery Agent examines prepared source notes rather than performing live external research.
The structured output contracts improve predictability, but they do not guarantee factual correctness or strong evidence. A result can match the expected schema while still relying on weak, incomplete, or misleading underlying material.
This example also does not yet save findings, retrieve full source content, or implement a full recovery strategy for contradictory evidence, missing fields, or failed model calls.
These limitations are intentional. In later lessons, we’ll introduce model-driven orchestration, failure handling, and governed workflows that preserve human approval before persistence.
What Did You Learn?
Agent specialization separates a larger task into responsibilities that can be assigned, inspected, and tested independently.
Structured output contracts make information exchange more predictable by defining the expected format of agent results.
However, specialization does not automatically provide tools, guarantee better answers, or change who controls execution.
In our current architecture, Python still orchestrates the workflow.
Test Your Understanding
Question 1 of 3
What is the main architectural benefit of defining specialized agents?