How dzhng/deep-research works
Open Deep Research is an iterative research assistant exposed through an interactive CLI and an HTTP API. A user supplies a topic and breadth/depth; the CLI can first collect follow-up answers. The research engine generates search queries, searches and analyzes web results into learnings and follow-up directions, and recursively explores them until depth is exhausted. It then produces a report or concise answer. The README also documents parallel search processing and configurable model providers. Edges reflect shown calls or README workflows; unsampled implementation details are omitted.
Main entry points: deep-research.ts Research Orchestrator · providers.ts Model Selection · run.ts Interactive CLI · api.ts HTTP API
Components 17
Entry Points
- Interactive CLI
src/run.ts - HTTP API
src/api.ts
Research Workflow
- Follow-up Questions
src/feedback.ts - Research Orchestrator
src/deep-research.ts - Query Generation
src/deep-research.ts - Web Search
src/deep-research.ts - Result Analysis
src/deep-research.ts - Recursive Exploration
src/deep-research.ts
AI Support
- Model Selection
src/ai/providers.ts - Prompt Trimming
src/ai/providers.ts - Text Splitting
src/ai/text-splitter.ts - Research Instructions
src/prompt.ts
Results
- Markdown Report
src/deep-research.ts - Concise Answer
src/deep-research.ts
Other components
- Researcher
- LLM Provider
- Firecrawl Search
Connections 27
- Researcher → Interactive CLI: enters query
src/run.ts - Researcher → HTTP API: submits request
src/api.ts - Interactive CLI → Follow-up Questions: requests questions
src/run.ts - Interactive CLI → Research Orchestrator: starts research
src/run.ts - Interactive CLI → Markdown Report: requests report
src/run.ts - Interactive CLI → Concise Answer: requests answer
src/run.ts - HTTP API → Research Orchestrator: starts research
src/api.ts - HTTP API → Markdown Report: requests report
src/api.ts - HTTP API → Concise Answer: requests answer
src/api.ts - Follow-up Questions → Model Selection: gets model
src/feedback.ts - Follow-up Questions → Research Instructions: uses instructions
src/feedback.ts - Research Orchestrator → Query Generation: generates queries
src/deep-research.ts - Research Orchestrator → Web Search: runs searches
src/deep-research.ts - Research Orchestrator → Result Analysis: processes results
src/deep-research.ts - Research Orchestrator → Recursive Exploration: recurses by depth
src/deep-research.ts - Research Orchestrator → Markdown Report: generates report
src/deep-research.ts - Research Orchestrator → Concise Answer: generates answer
src/deep-research.ts - Query Generation → Model Selection: gets model
src/deep-research.ts - Query Generation → Research Instructions: uses instructions
src/deep-research.ts - Result Analysis → Model Selection: gets model
src/deep-research.ts - Result Analysis → Research Instructions: uses instructions
src/deep-research.ts - Web Search → Firecrawl Search: searches and scrapes
src/deep-research.ts - Markdown Report → Model Selection: gets model
src/deep-research.ts - Concise Answer → Model Selection: gets model
src/deep-research.ts - Model Selection → LLM Provider: selects provider
src/ai/providers.ts - Model Selection → Prompt Trimming: trims prompts
src/ai/providers.ts - Prompt Trimming → Text Splitting: splits oversized text
src/ai/providers.ts