GitHub - dzhng/deep-research: An AI-powered research assistant that performs iterative, deep research on any topic by combining search engines, web scraping, and large language models. The goal of this repo is to provide the simplest implementation of a deep research agent - e.g. an agent that can refine its research direction overtime and deep dive into a topic.
Key Points
- 1This repository introduces an AI-powered research assistant designed for iterative, deep research by combining search engines, web scraping, and large language models.
- 2It operates by iteratively generating intelligent queries, processing results, and refining research directions based on user-defined breadth and depth parameters.
- 3The system produces comprehensive markdown reports, offers smart follow-up questions to refine research, and supports various API integrations for efficient information gathering.
The paper introduces "Deep Research," an AI-powered research assistant designed for iterative, in-depth exploration of any topic by integrating search engines, web scraping, and large language models (LLMs). The project's core goal is to provide a minimalist yet effective implementation of a deep research agent capable of refining its research direction over time and progressively deepening its understanding of a subject.
The methodology operates through an iterative, recursive workflow. It begins by taking a user-defined query, along with "breadth" and "depth" parameters, which respectively control the scope and recursion level of the research. Optionally, it engages the user with follow-up questions to refine the initial research direction and better align with the user's needs.
The core research process is as follows:
- SERP Query Generation: Leveraging LLMs, the system intelligently generates targeted search engine result page (SERP) queries based on the evolving research goals and prior findings.
- Result Processing: These queries are executed, and the results are processed. This involves web scraping and content extraction, primarily facilitated by the Firecrawl API, to retrieve and parse relevant information from web pages.
- Learnings and Direction Generation: An LLM then analyzes the extracted content to synthesize key "learnings" and identify "new directions" for further investigation. This step involves summarizing findings and formulating subsequent questions or topics.
- Recursive Exploration: A crucial decision point follows, checking the current "depth" parameter. If the current depth is greater than zero (i.e., ), the system uses the newly generated "next directions" (which encapsulate prior goals, new questions, and learnings) as new context to re-enter the deep research cycle, generating new SERP queries and continuing the iterative process. This recursive loop allows the agent to deep dive into sub-topics and build upon previous knowledge.
- Report Generation: Once the depth parameter is exhausted (i.e., ), the recursive process terminates. All accumulated findings, learnings, and sources are then compiled into a comprehensive, organized markdown report, ensuring traceability and readability.
Key features supporting this methodology include:
- Intelligent Query Generation: LLMs are instrumental in dynamically creating contextually relevant search queries.
- Depth & Breadth Control: Configurable parameters allow users to fine-tune the extensiveness (breadth, e.g., 3-10 search queries per iteration) and profundity (depth, e.g., 1-5 iterations) of the research.
- Smart Follow-up: Initial conversational interactions help disambiguate and refine the user's intent.
- Concurrent Processing: The system supports parallel execution of multiple search and result processing tasks, enhancing efficiency, especially with paid Firecrawl API tiers or local instances.
The technical stack is built on Node.js and requires API keys for the Firecrawl API (for web search and content extraction) and the OpenAI API (for LLM functionalities, specifically the o3-mini model by default). The architecture supports custom LLM endpoints and models, including local LLMs, and can integrate with specialized models like DeepSeek R1 via Fireworks API keys. Environment variables (FIRECRAWL_KEY, OPENAI_KEY, OPENAI_ENDPOINT, OPENAI_MODEL, FIREWORKS_KEY, CONCURRENCY_LIMIT) manage API access and system behavior. The project also provides Docker support for easy deployment.