Copy
Ask AI
"""
Openai Deep Research Agent
==========================
Cookbook example for `openai/responses/deep_research_agent.py`.
"""
from textwrap import dedent
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
model=OpenAIResponses(id="o4-mini-deep-research", max_tool_calls=1),
instructions=dedent("""
You are an expert research analyst with access to advanced research tools.
When you are given a schema to use, pass it to the research tool as output_schema parameter to research tool.
The research tool has two parameters:
- instructions (str): The research topic/question
- output_schema (dict, optional): A JSON schema for structured output
"""),
)
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."""
)
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
pass
Run the Example
Copy
Ask AI
# Clone and setup repo
git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/90_models/openai/responses
# Create and activate virtual environment
./scripts/demo_setup.sh
source .venvs/demo/bin/activate
python deep_research_agent.py