web_search result directly, use a parent response to delegate focused research tasks to child responses.
Each child performs its own searches and returns a compact memo.
The parent only consumes those memos, which lets the overall workflow search much more aggressively without flooding the parent context.
This is a specialized version of the general subagent pattern.
Here the parent is a research orchestrator and the children are research workers.
Deep research flow
-> parent response plans the research
-> parent calls spawn_subagent several times
-> your app runs child responses with web_search
-> children return compact research memos
-> your app sends all child memos back as function_call_output
-> parent resumes, decides whether to do another wave, then answers
Why use subagents for deep research
In a classic single-agent deep research loop, one response keeps callingweb_search.
That works until the response has seen too many search results and starts to run out of useful context budget.
Subagents fix that by splitting the work:
- The parent keeps the global plan and final synthesis.
- Each child handles one focused research task and can do several searches of its own.
- The parent sees only the child memo, not every raw search result.
- The parent can delegate a second or third wave if the first wave is weak or conflicting.
Design the parent and child differently
The parent should not search directly. Its job is to decompose the request, launch multiple subagents in parallel, and decide whether another wave is needed. The children should search directly. Their job is to do the focused work, push past weak initial results, and return compact evidence for the parent. A good split looks like this:- Parent: planning, task decomposition, conflict resolution, final answer.
- Child: query refinement, repeated search, source evaluation, memo writing.
Define the delegation tool
Keep the tool schema small. Pass only the child task, optional instructions, and an optional model override.Give the parent an orchestration prompt
The parent prompt should force decomposition and breadth. For deep research, tell the parent to use several subagents by default and to launch another wave when the first one is weak.Give the child a stricter research prompt
The child prompt should restore the search intensity that single-agent deep research often has naturally. Without this, a child may stop after one weak search and return a memo saying what it would do next.Run the child with web_search
Each child is just another Responses request.
Give it the delegated task as input and the web_search tool.
Continue weak children instead of accepting them
For deep research, do not accept a child result just because the child returned text. If the child only searched once, produced a short memo, or said things like “next steps” or “I need to search more”, continue that same child withprevious_response_id.
countCompletedWebSearches helper depends on whether you are using streamed events or stored output items.
The important idea is to count actual completed search operations, not just turns.
Run a parent wave, then fan in all child memos
The parent should be allowed to emit severalspawn_subagent calls in one turn.
Treat those tool calls as a batch.
Start every child, wait for every child to finish, and then resume the parent once with all child outputs.
- Parent creates a research plan.
- Parent emits a batch of
spawn_subagentcalls. - Your app runs all children in parallel.
- Weak children continue into another pass.
- Your app sends all final child memos back together.
- Parent either launches another wave or answers.
Stream and log the research process
Deep research is much easier to debug if you log the child search lifecycle. Useful logs include:- parent response created
- each delegated task
- each child search query
- each child search result batch
- each child memo preview
- when a weak child is continued into another pass
- parent resume with the final child batch
Practical rules for deep research
- Use
parallel_tool_calls: trueon the parent so it can launch several subagents in one turn. - Keep child outputs compact. The parent should receive evidence summaries, not raw research dumps.
- Prefer several focused child tasks over one vague child task.
- If a child mostly finds directories or generic landing pages, keep pushing that child instead of accepting the first memo.
- Do not resume the parent early with only part of a child batch.
- Keep
store: trueon while developing so you can inspect parent and child responses afterward. - If you are acting on behalf of an end user, send the same
X-On-Behalf-Ofvalue on parent and child requests.
Common pitfalls
- Too few subagents: the parent synthesizes before the research has real breadth.
- Weak children: a child returns after one weak search with “next steps” instead of doing more work.
- Oversized child memos: the parent gains little because the child passes back too much raw context.
- Early fan-in: resuming the parent before every child in a batch has finished makes the workflow less predictable.
- Source quality drift: children may overuse directories, profile sites, and aggregators unless the prompt explicitly tells them to prioritize primary sources.