Skip to main content

Overview

The AI Deep Research Agent is a powerful research assistant that leverages OpenAI’s Agents SDK and Firecrawl’s deep research capabilities to perform comprehensive web research on any topic. The system uses a two-agent architecture where one agent performs deep research and another enhances the findings with additional context and insights.

Tutorial Available

Follow our complete step-by-step tutorial to build this from scratch

Architecture

Agent Coordination Pattern

The Deep Research Agent uses a sequential coordination pattern with two specialized agents:

Agent Roles

Responsibilities:
  • Perform deep web research using Firecrawl
  • Gather comprehensive information from multiple sources
  • Organize findings into structured reports
  • Include proper citations
Tools:
  • deep_research: Firecrawl’s deep research endpoint with configurable depth and time limits
Configuration:
Responsibilities:
  • Enhance initial research reports
  • Add detailed explanations of complex concepts
  • Include relevant examples and case studies
  • Expand on key points with additional context
  • Add visual element descriptions
  • Incorporate trends and predictions
Approach:
  • Maintains academic rigor
  • Preserves original structure
  • Focuses on value-added content

Implementation

Key Features

Deep Web Research

Automatically searches the web, extracts content, and synthesizes findings from multiple sources

Enhanced Analysis

Uses AI to elaborate on research findings with additional context and insights

Interactive UI

Clean Streamlit interface for easy interaction and real-time progress updates

Downloadable Reports

Export research findings as markdown files for offline use

Research Process

  1. Input Phase: User provides a research topic and API credentials
  2. Research Phase: The tool uses Firecrawl to search the web and extract relevant information
  3. Analysis Phase: An initial research report is generated based on the findings
  4. Enhancement Phase: A second agent elaborates on the initial report, adding depth and context
  5. Output Phase: The enhanced report is presented to the user and available for download

Example Research Topics

Installation

1

Clone Repository

2

Install Dependencies

Required packages:
  • openai-agents
  • firecrawl-py
  • streamlit
3

Run Application

4

Configure API Keys

Enter your API keys in the sidebar:

Technical Details

Agent Communication

The agents communicate through a sequential handoff pattern:

Firecrawl Integration

Firecrawl’s deep research tool performs:
  • Multiple iterations of web searches
  • Content extraction from various sources
  • Automatic synthesis of findings
  • Citation management

Performance Considerations

Deep research can take several minutes depending on:
  • max_depth: Higher depth = more thorough but slower
  • time_limit: Maximum time allowed for research
  • max_urls: Number of sources to analyze
Typical research takes 3-5 minutes with default settings.

Best Practices

  • Be specific in your research queries
  • Include context for better results
  • Use clear, focused questions
  • Avoid overly broad topics
  • Start with default parameters (depth=3, time=180s, urls=10)
  • Increase depth for more comprehensive research
  • Adjust time_limit based on topic complexity
  • More URLs provide broader coverage but take longer
  • Each research query uses both OpenAI and Firecrawl API calls
  • Monitor your API usage in both dashboards
  • Consider caching results for similar queries
  • Use appropriate model tiers for your needs

Multi-Agent Researcher

Advanced multi-agent research system

Legal Agent Team

Document analysis with agent teams

Finance Agent Team

Financial research and analysis