DeepResearchAgent Module

Automated deep research workflows using OpenAI and Gemini Deep Research APIs

DeepResearchAgent Module

The DeepResearchAgent class automates complex research workflows using Deep Research APIs from multiple providers.

Supported Providers

  • OpenAI: o3-deep-research, o4-mini-deep-research (via Responses API)
  • Gemini: deep-research-pro (via Interactions API)

Import

python
from praisonaiagents import DeepResearchAgent

Quick Example

python
from praisonaiagents import DeepResearchAgent

# OpenAI Deep Research
agent = DeepResearchAgent(
    name="Research Assistant",
    model="o3-deep-research",
    instructions="You are a professional researcher..."
)

result = agent.research("What are the economic impacts of AI on healthcare?")
print(result.report)

for citation in result.citations:
    print(f"- {citation.title}: {citation.url}")

Constructor

DeepResearchAgent()

Creates a new DeepResearchAgent instance.

Parameters:

ParameterTypeDefaultDescription
namestr"Deep Research Agent"Agent name
modelstr"o3-deep-research"Deep research model to use
instructionsstr""System instructions for research
verboseboolFalseEnable verbose logging

Methods

research(query)

Performs deep research on a given query.

Parameters:

  • query (str): The research question or topic

Returns: ResearchResult – Contains report, citations, reasoning steps

async_research(query)

Async version of the research method.

Parameters:

  • query (str): The research question or topic

Returns: ResearchResult – Contains report, citations, reasoning steps

Data Classes

Citation

Represents a citation in the research report.

python
@dataclass
class Citation:
    title: str
    url: str
    start_index: int = 0
    end_index: int = 0

ReasoningStep

Represents a reasoning step in the research process.

python
@dataclass
class ReasoningStep:
    text: str
    type: str = "reasoning"

WebSearchCall

Represents a web search call made during research.

python
@dataclass
class WebSearchCall:
    query: str
    status: str

ResearchResult

The complete result of a research operation.

python
@dataclass
class ResearchResult:
    report: str
    citations: List[Citation]
    reasoning_steps: List[ReasoningStep]
    web_searches: List[WebSearchCall]
    metadata: Dict[str, Any]

Example with Gemini

python
from praisonaiagents import DeepResearchAgent

# Gemini Deep Research
agent = DeepResearchAgent(
    name="Research Assistant",
    model="deep-research-pro",
    instructions="You are a professional researcher..."
)

result = agent.research("Latest developments in quantum computing")
print(result.report)

Related