Deep Research Agent

Run an OpenAIResponses agent on the o4-mini-deep-research model with max_tool_calls=1 to produce a cited, data-backed report on semaglutide's economic impact on healthcare.

Code

from agno.agent import Agent
from agno.models.openai import OpenAIResponses

agent = Agent(
    model=OpenAIResponses(id="o4-mini-deep-research", max_tool_calls=1),
    instructions="Research the question using reliable sources and cite supporting evidence.",
)

agent.print_response(
    """Research the economic impact of semaglutide on global healthcare systems.
    Do:
    - Include specific figures, trends, statistics, and measurable outcomes.
    - Prioritize reliable, up-to-date sources: peer-reviewed research, health
      organizations (e.g., WHO, CDC), regulatory agencies, or pharmaceutical
      earnings reports.
    - Include inline citations and return all source metadata.

    Be analytical, avoid generalities, and ensure that each section supports
    data-backed reasoning that could inform healthcare policy or financial modeling."""
)

Agno supplies the built-in web search tool for this Deep Research model. max_tool_calls=1 limits the tool budget; increase it when the research task needs more source gathering. This example does not register a custom research function or a structured-output schema.

Usage

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Set your API key

export OPENAI_API_KEY=xxx

Install dependencies

uv pip install -U openai agno

Run Agent

Save the code above as deep_research_agent.py, then run:

python deep_research_agent.py