Skip to content

langchain-ai/open_deep_research

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Deep Research

Open Deep Research is a web research assistant that generates comprehensive reports on any topic following a workflow similar to OpenAI and Gemini Deep Research.However, it allows you to customize the models, prompts, report structure, search API, and research depth. Specifically, you can customize:

  • provide an outline with a desired report structure
  • set the planner model (e.g., DeepSeek, OpenAI reasoning model, etc)
  • give feedback on the plan of report sections and iterate until user approval
  • set the search API (e.g., Tavily, Perplexity) and # of searches to run for each research iteration
  • set the depth of search for each section (# of iterations of writing, reflection, search, re-write)
  • customize the writer model (e.g., Anthropic)

Short summary:

o3.quick-enhanced-v2-90p.mp4

📺 Video Tutorials

🚀 Quickstart

Clone the repository:

git clone https://github.com/langchain-ai/open_deep_research.git
cd open_deep_research

Select a web search tool, by default it is Tavily:

Select a writer model, by default it is Anthropic:

Select a planner model, by default it is OpenAI:

Set API keys for your selections above:

cp .env.example .env

Edit the .env file with your API keys (e.g., the API keys for default selections are shown below):

export TAVILY_API_KEY=<your_tavily_api_key>
export ANTHROPIC_API_KEY=<your_anthropic_api_key>
export OPENAI_API_KEY=<your_openai_api_key>

Launch the assistant with the LangGraph server, which will open in your browser:

Mac

# Install uv package manager
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install dependencies and start the LangGraph server
uvx --refresh --from "langgraph-cli[inmem]" --with-editable . --python 3.11 langgraph dev

Windows

# Install dependencies 
pip install -e .
pip install langgraph-cli[inmem]

# Start the LangGraph server
langgraph dev

Use this to open the Studio UI:

- 🚀 API: http://127.0.0.1:2024
- 🎨 Studio UI: https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024
- 📚 API Docs: http://127.0.0.1:2024/docs

(1) Provide a Topic and hit Submit:

Screenshot 2025-01-31 at 8 12 21 PM

(2) This will generate a report plan:

Screenshot 2025-01-31 at 8 12 44 PM

(3) You can review the section of the plan in Studio. If you like them, hit Continue.

(4) If you want to add feedback, add Feedback On Report Plan and Submit:

Screenshot 2025-01-31 at 8 13 40 PM

(5) If you have given feedback, continue iterating until you are happy and then select Accept Report Plan:

Screenshot 2025-01-31 at 8 14 19 PM

📖 Customizing the report

You can customize the research assistant's behavior through several parameters:

  • report_structure: Define a custom structure for your report (defaults to a standard research report format)
  • number_of_queries: Number of search queries to generate per section (default: 2)
  • max_search_depth: Maximum number of reflection and search iterations (default: 2)
  • planner_provider: Model provider for planning phase (default: "openai", but can be "groq")
  • planner_model: Specific model for planning (default: "o3-mini", but can be any Groq hosted model such as "deepseek-r1-distill-llama-70b")
  • writer_model: Model for writing the report (default: "claude-3-5-sonnet-latest")
  • search_api: API to use for web searches (default: Tavily)

These configurations allow you to fine-tune the research process based on your needs, from adjusting the depth of research to selecting specific AI models for different phases of report generation.

How it works

  1. Plan and Execute - Open Deep Research follows a plan-and-execute workflow that separates planning from research, allowing for human-in-the-loop approval of a report plan before the more time-consuming research phase. It uses, by default, a reasoning model to plan the report sections. During this phase, it uses web search to gather general information about the report topic to help in planning the report sections. But, it also accepts a report structure from the user to help guide the report sections as well as human feedback on the report plan.

  2. Research and Write - Each section of the report is written in parallel. The research assistant uses web search via Tavily API or Perplexity to gather information about each section topic. It will reflect on each report section and suggest follow-up questions for web search. This "depth" of research will proceed for any many iterations as the user wants. Any final sections, such as introductions and conclusions, are written after the main body of the report is written, which helps ensure that the report is cohesive and coherent. The planner determines main body versus final sections during the planning phase.

  3. Managing different types - Open Deep Research is built on LangGraph, which has native support for configuration management using assistants. The report structure is a field in the graph configuration, which allows users to create different assistants for different types of reports.

UX

Local deployment

Follow the quickstart to start LangGraph server locally.

Hosted deployment

You can easily deploy to LangGraph Platform .

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •