Skip to main content
The Deep Research Agent automates comprehensive research using OpenAI or Gemini Deep Research APIs with real-time streaming, web search, and structured citations.

Quick Start

1

Install Package

pip install praisonaiagents
2

Set API Key

# For OpenAI
export OPENAI_API_KEY=your_api_key_here

# For Gemini
export GEMINI_API_KEY=your_api_key_here
3

Create Script

from praisonaiagents import DeepResearchAgent

agent = DeepResearchAgent(
    model="o4-mini-deep-research",
    verbose=True
)

result = agent.research("What are the latest AI trends in 2025?")
print(result.report)

OpenAI Deep Research

from praisonaiagents import DeepResearchAgent

agent = DeepResearchAgent(
    model="o4-mini-deep-research",  # or "o3-deep-research"
    verbose=True
)

result = agent.research("What are the latest AI trends?")
print(result.report)
print(f"Citations: {len(result.citations)}")

Gemini Deep Research

from praisonaiagents import DeepResearchAgent

agent = DeepResearchAgent(
    model="deep-research-pro",
    verbose=True
)

result = agent.research("Research quantum computing advances")
print(result.report)

Features

Multi-Provider

Supports OpenAI, Gemini, and LiteLLM providers.

Real-time Streaming

See reasoning summaries and web searches as they happen.

Structured Citations

Get citations with titles and URLs.

Auto Detection

Provider automatically detected from model name.

Streaming Output

Streaming is enabled by default. You will see:
  • 💭 Reasoning summaries
  • 🔎 Web search queries
  • Final report text
# Streaming is ON by default
result = agent.research("Research topic")

# Disable streaming
result = agent.research("Research topic", stream=False)

Response Structure

result.report           # Full research report
result.citations        # List of citations with URLs
result.web_searches     # Web searches performed
result.reasoning_steps  # Reasoning steps captured
result.interaction_id   # Session ID (for Gemini follow-ups)

Available Models

ProviderModels
OpenAIo3-deep-research, o4-mini-deep-research
Geminideep-research-pro

Configuration Options

agent = DeepResearchAgent(
    name="Researcher",
    model="o4-mini-deep-research",
    instructions="Focus on data-rich insights",
    verbose=True,
    poll_interval=5,      # Gemini polling interval (seconds)
    max_wait_time=3600    # Max research time (seconds)
)

With Custom Instructions

from praisonaiagents import DeepResearchAgent

agent = DeepResearchAgent(
    model="o4-mini-deep-research",
    instructions="""
    You are a professional researcher. Focus on:
    - Data-rich insights with specific figures
    - Reliable sources and citations
    - Clear, structured responses
    """,
    verbose=True
)

result = agent.research("Economic impact of AI on healthcare")

Accessing Citations

result = agent.research("Research topic")

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

Next Steps

  • Learn about Research Agent for custom research workflows
  • Explore RAG for document-based research
  • Check out Memory for persistent research context