Deep research has broken out as one of the most popular agent applications. OpenAI, Anthropic, Perplexity and Google all have a deep research to produce comprehensive report
Built with LangGraph, this Deep research system orchestrates multiple specialized agents to conduct comprehensive research on complex topics. The system features a supervisor agent that coordinates parallel research activities using specialized research agents equipped with web search capabilities.
The system operates through three distinct phases:
- Intelligent Clarification: Analyzes user requests and asks targeted questions to refine research scope
- Context Gathering: Understands user needs, requirements, and expectations for the research
- Scope Definition: Transforms conversations into detailed research briefs with clear objectives
- Adaptive Research Strategy: Automatically determines whether to conduct parallel or sequential research based on topic complexity
- Multi-Agent Coordination: Supervisor agent orchestrates multiple specialized research agents
- Parallel Processing: Can run up to 3 research agents simultaneously for faster results
- Web Search Integration: Real-time web search using Tavily API for current information
- Strategic Thinking: Built-in reflection tools for quality decision-making during research
- Research Compression: Intelligent summarization of findings for efficient processing
- Comprehensive Synthesis: Combines all research findings into a cohesive, well-structured report
- Quality Assurance: Ensures accuracy and completeness of the final output
- Professional Formatting: Delivers polished, publication-ready research reports
- Python 3.13+
- API keys for your chosen model provider(s):
- OpenAI API key (for
gpt-4o-miniandgpt-4ovialangchain-openai)
- OpenAI API key (for
- A Tavily API key (for web search capabilities) or other search tool APIs
git clone https://github.com/jameskanyiri/langgraph_deep_research.git
# Using uv (recommended)
uv venv
source .venv/bin/activate
uv sync
# Or using pip
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .Copy .env.example to .env and set your keys.
cp .env.example .envRequired variables (choose based on your model provider):
OPENAI_API_KEY: Your OpenAI key used bylangchain-openai(if using OpenAI models)ANTHROPIC_API_KEY: Your Anthropic key used bylangchain-anthropic(if using Claude models)TAVILY_API_KEY: Your Tavily API key for web search capabilities
Optional (for LangChain telemetry):
LANGCHAIN_TRACING_V2,LANGCHAIN_API_KEY, etc.
This project ships a langgraph.json that points to the graph in src/graph.py.
langgraph devThis launches a local Dev UI in your browser. Select deep_research_agent and start chatting. The system operates through three distinct phases:
- Clarify your request if needed to ensure comprehensive coverage
- Gather context about what you need research on
- Generate a detailed research brief from the conversation
- Coordinate parallel research agents to investigate different aspects simultaneously
- Adapt research strategy (parallel or sequential) based on topic complexity
- Search and analyze information using web search capabilities
- Compress and synthesize findings into comprehensive results
- Generate the final research report with professional formatting
You can also run individual components:
research_agent: Individual research agent with search capabilitiessupervisor_agent: Supervisor that coordinates research activities
This deep research agent has been designed to achieve performance on par with many popular deep research agents. The multi-agent architecture, strategic thinking capabilities, and comprehensive research coordination enable it to compete effectively on the Deep Research Bench leaderboard.
The system operates through a sophisticated three-phase multi-agent pipeline:
Purpose: Understand what the user needs research on and refine the scope
clarify_user_request: Analyzes the user's request and decides whether clarification is needed- Context Gathering: Asks targeted questions to understand user requirements and expectations
write_research_brief: Transforms the conversation into a detailed research brief using structured output- Scope Definition: Creates clear objectives and research parameters
Purpose: Conduct thorough research on the defined topics
- Supervisor Agent: Orchestrates the research process using
gpt-4.1 - Adaptive Strategy: Decides whether to conduct parallel or sequential research based on topic complexity
- Parallel Execution: Launches multiple research agents simultaneously (up to 3 concurrent)
- Tool Management: Uses
ConductResearchandResearchCompletetools to coordinate activities
- Research Agents: Specialized agents using
gpt-4o-minifor focused research - Web Search: Integrated Tavily API for real-time web search capabilities
- Strategic Thinking: Built-in reflection tools for quality decision-making
- Research Compression: Intelligent summarization of findings for supervisor consumption
Purpose: Synthesize research findings into a comprehensive, well-structured report
- Comprehensive Synthesis: Combines all research findings into a cohesive narrative
- Quality Assurance: Ensures accuracy and completeness of the final output
- Professional Formatting: Delivers polished, publication-ready research reports
- Final Delivery: Presents findings in a clear, actionable format
InputState: Compatible with LangGraph message flowsAgentState: Extends state with research brief and supervisor messagesSupervisorState: Manages supervisor coordination and research iterationsResearcherState: Handles individual research agent state
- Tavily Search: Web search with result deduplication and processing
- Think Tool: Strategic reflection for research quality
- ConductResearch: Delegates research tasks to specialized agents
- ResearchComplete: Signals research completion
langgraph.json:
{
"graphs": {
"deep_research_agent": "src/graph.py:graph",
"research_agent": "src/research_agent/agent.py:research_agent",
"supervisor_agent": "src/supervisor/supervisor.py:supervisor_agent"
},
"dependencies": ["."],
"env": "./.env",
"python_version": "3.13"
}- Formatter/lint: follow your preferred toolchain. Code aims for clarity and explicitness.
- Python version pinned to 3.13 in
pyproject.tomlandlanggraph.json.
- "Model not found" or auth errors: ensure
OPENAI_API_KEYandTAVILY_API_KEYare set and valid. - Import errors for
langgraph,langchain-openai, ortavily-python: re-runuv syncorpip install -e .. - Dev UI doesn't show the graphs: confirm
langgraph.jsonpoints to the correct graph definitions and that your venv is active. - Research agents not finding results: check your Tavily API key and quota limits.
- Supervisor not launching research: verify the research brief is properly formatted and contains actionable research topics.
Add your preferred license here.
