---
title: "The Agent Deep Dive: David Zhang’s Open Deep Research"
description: "Exploring Zhang’s open-source Deep Research. We look at the prompting, search executions, and report creation, and compare it to both OpenAI’s and Perplexity’s Deep Research solutions."
ogImage: /images/blog/2025-02-20-the-agent-deep-dive-open-deep-research/the-agent-deep-dive.png
tag: agents
date: 2025/02/20
author: "Jannik"
---

AI-driven research is evolving fast. While Google pioneered Deep Research, OpenAI popularized it and Perplexity and Grok followed, open-source alternatives are just as exciting and help to understand how one of the first forms of autonomous _useful_ agents works. In this post, I take a closer look at the inner workings of open [deep-research](https://github.com/dzhng/deep-research) by David Zhang ([dzhng](https://github.com/dzhng))—a lightweight, transparent framework for iterative AI research.

At under 500 lines of code, `deep-research` packs a surprising punch. It runs recursive research loops, refining queries based on the information it finds—no hidden logic, no unnecessary dependencies, just a clean, modular setup that’s easy to hack or extend.

I decided to put it to the test. With [Langfuse](https://github.com/langfuse/langfuse), I traced its execution (thanks to [@hassiebp](https://github.com/hassiebp) for instrumenting it in this [fork](https://github.com/hassiebp/deep-research-with-langfuse)), broke down its decision-making, and measured performance. Below, I’ll show how it works, why it’s worth a look, and how it compares to other AI deep research tools.

---

## Why I Like This Agent

- **Simple** – Minimalist design, easy to modify, and fully open-source.
- **Iterative Research** – Runs deep research loops, refining its queries at each step.
- **Control Depth & Breadth** – Users define how far (depth) and wide (breadth) the research should go.
- **Parallel Execution** – Fires off multiple queries at once, speeding up research.

**Tech Stack**:

- **o3-mini** as the language model for SERP generation, learnings, and the final report.
- **Firecrawl** for executing SERP queries.

Despite its minimal footprint, the framework is robust enough to generate meaningful follow-up questions, refine its search, and compile a structured final report. This simplicity makes it an approachable playground for anyone looking to experiment with or build upon an iterative AI research agent.

---

## How Does the Agent Work?

To see how `deep-research` holds up, I asked it a more nuanced question:

> "I don't get how Whisper is fully open source (MIT), yet ChatGPT's speech-to-text is vastly better than Perplexity's and Apple's. Can you help me figure this out?"

This isn’t a simple fact lookup—it requires synthesizing multiple sources, filtering insights, and producing structured responses.

With a breadth of 4 and a depth of 2 (which are the two configuration options that are available), we might see the agent generate multiple parallel queries—and then refine those queries after it sees what the search turned up. You’d end up with a thorough markdown report summarizing everything, plus any missing links the agent found intriguing.

Each iteration of this loop can be viewed as an event within Langfuse. Tracking these events provides a step-by-step replay of the agent’s logic—useful for debugging and fine-tuning. Here’s the public trace in Langfuse:

[**Link to Public Trace**](https://cloud.langfuse.com/project/cm6y5qfi901bzad07tyaeg3no/traces/fd9be9b8-ffd2-435b-ba90-45a0af649954)

  ![Gantt
  chart](/images/blog/2025-02-20-the-agent-deep-dive-open-deep-research/gatt.png)

_Note: The chart above is a Gantt-like overview of query processes._

Next, let’s break down each step of the research loop in more detail.

<Steps>

### 1. Initial Query

The system message and user prompt are created. This is where the agent sets the context.

  ![Initial
  Query](/images/blog/2025-02-20-the-agent-deep-dive-open-deep-research/system-prompt.png)

### 2. Follow-Up Questions

The agent proposes up to three follow-up questions based on the initial prompt.

  ![Follow Up
  Questions](/images/blog/2025-02-20-the-agent-deep-dive-open-deep-research/follow-up-1.png)

### 3. Search Queries

Based on those follow-up questions, the agent generates SERP queries to investigate the topic further.

  ![Search
  Queries](/images/blog/2025-02-20-the-agent-deep-dive-open-deep-research/serp-queries.png)

### 4. Search Engine Calls

The system then spawns multiple queries to a search API (in this case, Firecrawl).

  ![Search Engine
  Calls](/images/blog/2025-02-20-the-agent-deep-dive-open-deep-research/context.png)

### 5. Learnings from the Content

After retrieving the search results, the agent processes them and generates up to three “learnings” (insights). It also proposes new follow-up questions, continuing the loop if necessary.

  ![Learnings](/images/blog/2025-02-20-the-agent-deep-dive-open-deep-research/learnings.png)

  ![Follow Up
  Questions](/images/blog/2025-02-20-the-agent-deep-dive-open-deep-research/follow-up.png)

### 6. Markdown Report

Finally, once the maximum research breadth (e.g., 4) and depth (e.g., 2) are reached, the agent compiles a Markdown report summarizing key findings. It uses all the intermediate “learnings” from previous steps to form a coherent answer.

  ![Markdown
  Report](/images/blog/2025-02-20-the-agent-deep-dive-open-deep-research/final-report.png)

</Steps>

Thanks to the instrumentation we added above, all these steps are tracked in Langfuse—timestamps, search calls, LLM calls, and final outputs—providing a transparent view of how the agent arrives at its answer.

---

## Comparison With Other AI Research Tools

Although `deep-research` is a small, open-source project, I wanted to see how it fares alongside two well-known AI tools: OpenAI’s ChatGPT (with advanced research features or higher usage tiers) and Perplexity Pro.

To keep it fair, I ran the **same** question on all three:

### David Zhang’s Open Deep Research

- **Time to finish**: ~3 minutes and 34 seconds
- **Estimated model usage cost**: ~$0.71
- **Generated report length**: ~12k characters
- **Trace**: [Langfuse Link](https://cloud.langfuse.com/project/cm6y5qfi901bzad07tyaeg3no/traces/fd9be9b8-ffd2-435b-ba90-45a0af649954)

### OpenAI’s Deep Research

- **Time to finish**: ~6 minutes
- **Insights**: ~27 sources
- **Generated report length**: ~87k characters
- **Costs**: Hard to pin down exactly; it likely depends on o3 and crawler usage.
- **Example link**: [OpenAI Example Thread](https://chatgpt.com/share/67aa55e9-1cb4-8009-a3c1-69607e6ca1cd)

### Perplexity Pro Deep Research

- **Time to finish**: ~3 minutes
- **Insights**: ~49 sources
- **Report length**: ~8k characters
- **Link to Perplexity Thread**: [Perplexity Deep Research Example](https://www.perplexity.ai/search/i-don-t-get-how-whisper-is-ful-Uuq8BQh8SyOOkAuOeG0j_Q)

## Takeaways

- `deep-research` is impressively agile for a lean, open-source tool.
- Perplexity’s product can pull in a larger number of sources quickly, leveraging its specialization on web search.
- OpenAI’s Deep Research produced a lengthy report, utilized more sources, and conducted a thorough investigation based on follow-up searches. Overall, the reasoning capabilities (o3, post-training for this use case) are significantly stronger than those of the other contestants.

Ultimately, if you want transparency, low cost, and hackability, David Zhang’s `deep-research` stands out. If you need huge reports or integrated browsing at scale, you may prefer a more mature commercial solution.

## Other Open Source Research Agent Frameworks

If you’re interested in exploring similar projects, check out these options:

- [Hugging Face’s open-deep-research](https://github.com/huggingface/smolagents/tree/gaia-submission-r1/examples/open_deep_research)
- [assafelovic/gpt-researcher](https://github.com/assafelovic/gpt-researcher)
- [jina-ai/node-DeepResearch](https://github.com/jina-ai/node-DeepResearch)

## What's Next?

I will do more deep dives on interesting OSS agents to dissect how they work and what's interesting about them. Email me if you have suggestions: agent-deep-dive@langfuse.com

<!-- agent-instructions -->

---

## Agent Instructions

This page is part of the [Langfuse](https://langfuse.com) documentation, published as plain Markdown for AI agents. Every page is available as Markdown by appending `.md` to its URL, or by sending an `Accept: text/markdown` header. This page: `https://langfuse.com/blog/2025-02-20-the-agent-deep-dive-open-deep-research.md`.

### Querying these docs

If the answer is not on this page, query the documentation instead of guessing:

- **Semantic search** across all Langfuse docs, returning an answer with the relevant pages and excerpts. Ask a specific, self-contained question:

  ```bash
  curl -sG "https://langfuse.com/api/search-docs" --data-urlencode "query=How do I trace a LangGraph agent?"
  ```

- **Index of every page**: <https://langfuse.com/llms.txt>, with per-section indexes [llms-docs.txt](https://langfuse.com/llms-docs.txt), [llms-integrations.txt](https://langfuse.com/llms-integrations.txt), and [llms-self-hosting.txt](https://langfuse.com/llms-self-hosting.txt).

### Before writing Langfuse code

- **Install the [Langfuse Agent Skill](https://langfuse.com/docs/api-and-data-platform/features/agent-skill).** It encodes Langfuse's own best practices for instrumentation, prompt management, and evaluation, and materially improves results.
- **Read [What does a good trace look like?](https://langfuse.com/docs/observability/best-practices.md)** before instrumenting an application.
- **Verify endpoints, parameters, and response fields** against the [API reference](https://api.reference.langfuse.com) instead of inferring them from code examples.
- **Use the [Langfuse CLI](https://langfuse.com/docs/api-and-data-platform/features/cli)** (`npx langfuse-cli api <resource> <action>`) to read or write traces, prompts, datasets, and scores from the terminal.

Found an error in these docs? Please open an issue at <https://github.com/langfuse/langfuse-docs/issues>.
