# Open Deep Research

> An open-source AI research assistant that performs iterative, deep research on any topic by combining search engines, web scraping, and large language models.

Open Deep Research is an open-source TypeScript project created by David Zhang (dzhng) and associated with Duet. It provides a minimal, readable implementation of a deep research agent — one that iteratively refines its research direction and dives deeper into a topic using LLMs, SERP queries, and web scraping. The repository is intentionally kept under 500 lines of code to remain easy to understand and build upon.

## What It Is

Open Deep Research is a CLI-based autonomous research agent that takes a user query and two configurable parameters — breadth and depth — and recursively explores a topic until it has gathered enough information to produce a comprehensive markdown report. It belongs to the category of agentic research tools that chain LLM reasoning with live web search, as opposed to static knowledge retrieval. The core loop generates SERP queries, processes results into learnings and new research directions, and recurses until the depth parameter reaches zero.

## How the Autonomy Loop Works

The agent follows a structured recursive flow:

- **Input**: User query + breadth (3–10, default 4) + depth (1–5, default 2)
- **Follow-up questions**: LLM generates clarifying questions before starting
- **SERP query generation**: Multiple targeted queries are generated per iteration
- **Result processing**: Extracts key learnings and new research directions from scraped content
- **Recursive exploration**: If depth > 0, the agent continues with new directions and accumulated context
- **Report generation**: All findings are compiled into a markdown report saved as `report.md` or `answer.md`

Concurrent processing is supported to run multiple searches and result extractions in parallel, with a configurable `CONCURRENCY_LIMIT` environment variable.

## Model and API Flexibility

By default, the tool uses OpenAI's o3-mini model via the OpenAI API and Firecrawl for web search and content extraction. It also supports:

- **DeepSeek R1** via Fireworks AI — automatically activated when a `FIREWORKS_KEY` is set
- **Local LLMs** — by pointing `OPENAI_ENDPOINT` to a local server (e.g., LM Studio) and setting `OPENAI_MODEL`
- **Custom OpenAI-compatible endpoints** — via `OPENAI_ENDPOINT` and `CUSTOM_MODEL` env vars, enabling OpenRouter, Gemini, and others
- **Self-hosted Firecrawl** — via `FIRECRAWL_BASE_URL`

## Setup Path

The project runs in a Node.js environment and can also be deployed via Docker. Setup involves cloning the repository, running `npm install`, and configuring a `.env.local` file with API keys for Firecrawl and OpenAI (or alternatives). A Docker Compose workflow is also provided for containerized use.

## Adoption Signal

According to GitHub data, the repository has accumulated over 19,000 stars and nearly 2,000 forks since its creation in February 2025, with active maintenance through April 2026. A community Python port is also available at a separate repository. The project is licensed under the MIT License, making it freely usable, modifiable, and distributable.

## Features
- Iterative deep research with configurable breadth and depth parameters
- Intelligent SERP query generation using LLMs
- Web scraping and content extraction via Firecrawl
- Recursive exploration with accumulated context
- Follow-up question generation to refine research direction
- Comprehensive markdown report output
- Concurrent search and result processing
- Support for OpenAI o3-mini, DeepSeek R1, and local LLMs
- Custom OpenAI-compatible endpoint support
- Docker deployment support
- Self-hosted Firecrawl support

## Integrations
OpenAI API, Firecrawl, Fireworks AI (DeepSeek R1), OpenRouter, Google Gemini (via OpenAI-compatible endpoint), Local LLM servers (e.g., LM Studio)

## Platforms
API, CLI

## Pricing
Open Source

## Version
main

## Links
- Website: https://github.com/dzhng/deep-research
- Documentation: https://github.com/dzhng/deep-research#readme
- Repository: https://github.com/dzhng/deep-research
- EveryDev.ai: https://www.everydev.ai/tools/open-deep-research
