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
from praisonaiagents import DeepResearchAgentQuick Example
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:
| Parameter | Type | Default | Description |
|---|---|---|---|
name | str | "Deep Research Agent" | Agent name |
model | str | "o3-deep-research" | Deep research model to use |
instructions | str | "" | System instructions for research |
verbose | bool | False | Enable 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.
@dataclass
class Citation:
title: str
url: str
start_index: int = 0
end_index: int = 0ReasoningStep
Represents a reasoning step in the research process.
@dataclass
class ReasoningStep:
text: str
type: str = "reasoning"WebSearchCall
Represents a web search call made during research.
@dataclass
class WebSearchCall:
query: str
status: strResearchResult
The complete result of a research operation.
@dataclass
class ResearchResult:
report: str
citations: List[Citation]
reasoning_steps: List[ReasoningStep]
web_searches: List[WebSearchCall]
metadata: Dict[str, Any]Example with Gemini
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
- Agent Module – Base Agent class
- QueryRewriterAgent Module – Query optimization for RAG
- Knowledge Module – Knowledge base integration