Skip to content
Back to search

deep-research

Use any LLMs (Large Language Models) for Deep Research. Support SSE API and MCP server.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/u14app--deep-research/badge.svg)](/listings/u14app--deep-research)

HTML

<a href="/listings/u14app--deep-research"><img src="/api/listings/u14app--deep-research/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. **Clone the repository:**

   git clone https://github.com/u14app/deep-research.git
   cd deep-research

2. **Install dependencies:**

   pnpm install  # or npm install or yarn install

3. **Set up Environment Variables:**

You need to modify the file `env.tpl` to `.env`, or create a `.env` file and write the variables to this file.

   # For Development
   cp env.tpl .env.local
   # For Production
   cp env.tpl .env

4. **Run the development server:**

   pnpm dev  # or npm run dev or yarn dev

Open your browser and visit [http://localhost:3000](http://localhost:3000) to access Deep Research.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 453 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. <h1>Deep Research</h1>
  3. ![GitHub deployments](https://img.shields.io/github/deployments/u14app/gemini-next-chat/Production)
  4. ![GitHub Release](https://img.shields.io/github/v/release/u14app/deep-research)
  5. ![Docker Image Size](https://img.shields.io/docker/image-size/xiangfa/deep-research/latest)
  6. ![Docker Pulls](https://img.shields.io/docker/pulls/xiangfa/deep-research)
  7. [![License: MIT](https://img.shields.io/badge/License-MIT-default.svg)](https://opensource.org/licenses/MIT)
  8. [![Gemini](https://img.shields.io/badge/Gemini-8E75B2?style=flat&logo=googlegemini&logoColor=white)](https://ai.google.dev/)
  9. [![Next](https://img.shields.io/badge/Next.js-111111?style=flat&logo=nextdotjs&logoColor=white)](https://nextjs.org/)
  10. [![Tailwind CSS](https://img.shields.io/badge/Tailwind%20CSS-06B6D4?style=flat&logo=tailwindcss&logoColor=white)](https://tailwindcss.com/)
  11. [![shadcn/ui](https://img.shields.io/badge/shadcn/ui-111111?style=flat&logo=shadcnui&logoColor=white)](https://ui.shadcn.com/)
  12. [![Vercel](https://img.shields.io/badge/Vercel-111111?style=flat&logo=vercel&logoColor=white)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fu14app%2Fdeep-research&project-name=deep-research&repository-name=deep-research)
  13. [![Cloudflare](https://img.shields.io/badge/Cloudflare-F69652?style=flat&logo=cloudflare&logoColor=white)](./docs/How-to-deploy-to-Cloudflare-Pages.md)
  14. [![PWA](https://img.shields.io/badge/PWA-blue?style=flat&logo=pwa&logoColor=white)](https://research.u14.app/)
  15. [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/u14app/deep-research)
  16. </div>
  17. **Lightning-Fast Deep Research Report**
  18. Deep Research uses a variety of powerful AI models to generate in-depth research reports in just a few minutes. It leverages advanced "Thinking" and "Task" models, combined with an internet connection, to provide fast and insightful analysis on a variety of topics. **Your privacy is paramount - all data is processed and stored locally.**
  19. ## ✨ Features
  20. - **Rapid Deep Research:** Generates comprehensive research reports in about 2 minutes, significantly accelerating your research process.
  21. - **Multi-platform Support:** Supports rapid deployment to Vercel, Cloudflare and other platforms.
  22. - **Powered by AI:** Utilizes the advanced AI models for accurate and insightful analysis.
  23. - **Privacy-Focused:** Your data remains private and secure, as all data is stored locally on your browser.
  24. - **Support for Multi-LLM:** Supports a variety of mainstream large language models, including Gemini, OpenAI, Anthropic, Deepseek, Atlas Cloud, Grok, Mistral, Azure OpenAI, any OpenAI Compatible LLMs, OpenRouter, Ollama, etc.
  25. - **Support Web Search:** Supports search engines such as Searxng, Tavily, Firecrawl, fastCRW, Exa, Bocha, Brave, etc., allowing LLMs that do not support search to use the web search function more conveniently.
  26. - **Thinking & Task Models:** Employs sophisticated "Thinking" and "Task" models to balance depth and speed, ensuring high-quality results quickly. Support switching research models.
  27. - **Support Further Research:** You can refine or adjust the research content at any stage of the project and support re-research from that stage.
  28. - **Local Knowledge Base:** Supports uploading and processing text, Office, PDF and other resource files to generate local knowledge base.
  29. - **Artifact:** Supports editing of research content, with two editing modes: WYSIWYM and Markdown. It is possible to adjust the reading level, article length and full text translation.
  30. - **Knowledge Graph:** It supports one-click generation of knowledge graph, allowing you to have a systematic understanding of the report content.
  31. - **Research History:** Support preservation of research history, you can review previous research results at any time and conduct in-depth research again.
  32. - **Local & Server API Support:** Offers flexibility with both local and server-side API calling options to suit your needs.
  33. - **Support for SaaS and MCP:** You can use this project as a deep research service (SaaS) through the SSE API, or use it in other AI services through MCP service.
  34. - **Support PWA:** With Progressive Web App (PWA) technology, you can use the project like a software.
  35. - **Support Multi-Key payload:** Support Multi-Key payload to improve API response efficiency.
  36. - **Multi-language Support**: English, 简体中文, Español.
  37. - **Built with Modern Technologies:** Developed using Next.js 15 and Shadcn UI, ensuring a modern, performant, and visually appealing user experience.
  38. - **MIT Licensed:** Open-source and freely available for personal and commercial use under the MIT License.
  39. ## 🎯 Roadmap
  40. - [x] Support preservation of research history
  41. - [x] Support editing final report and search results
  42. - [x] Support for other LLM models
  43. - [x] Support file upload and local knowledge base
  44. - [x] Support SSE API and MCP server
  45. ## 🚀 Getting Started
  46. ### Use Free Gemini (recommend)
  47. 1. Get [Gemini API Key](https://aistudio.google.com/app/apikey)
  48. 2. One-click deployment of the project, you can choose to deploy to Vercel or Cloudflare
  49. [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fu14app%2Fdeep-research&project-name=deep-research&repository-name=deep-research)
  50. Currently the project supports deployment to Cloudflare, but you need to follow [How to deploy to Cloudflare Pages](./docs/How-to-deploy-to-Cloudflare-Pages.md) to do it.
  51. 3. Start using
  52. ### Use Other LLM
  53. 1. Deploy the project to Vercel or Cloudflare
  54. 2. Set the LLM API key
  55. 3. Set the LLM API base URL (optional)
  56. 4. Start using
  57. ## ⌨️ Development
  58. Follow these steps to get Deep Research up and running on your local browser.
  59. ### Prerequisites
  60. - [Node.js](https://nodejs.org/) (version 18.18.0 or later recommended)
  61. - [pnpm](https://pnpm.io/) or [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/)
  62. ### Installation
  63. 1. **Clone the repository:**
  64. ```bash
  65. git clone https://github.com/u14app/deep-research.git
  66. cd deep-research
  67. ```
  68. 2. **Install dependencies:**
  69. ```bash
  70. pnpm install # or npm install or yarn install
  71. ```
  72. 3. **Set up Environment Variables:**
  73. You need to modify the file `env.tpl` to `.env`, or create a `.env` file and write the variables to this file.
  74. ```bash
  75. # For Development
  76. cp env.tpl .env.local
  77. # For Production
  78. cp env.tpl .env
  79. ```
  80. 4. **Run the development server:**
  81. ```bash
  82. pnpm dev # or npm run dev or yarn dev
  83. ```
  84. Open your browser and visit [http://localhost:3000](http://localhost:3000) to access Deep Research.
  85. ### Custom Model List
  86. The project allow custom model list, but **only works in proxy mode**. Please add an environment variable named `NEXT_PUBLIC_MODEL_LIST` in the `.env` file or environment variables page.
  87. Custom model lists use `,` to separate multiple models. If you want to disable a model, use the `-` symbol followed by the model name, i.e. `-existing-model-name`. To only allow the specified model to be available, use `-all,+new-model-name`.
  88. ## 🚢 Deployment
  89. ### Vercel
  90. [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fu14app%2Fdeep-research&project-name=deep-research&repository-name=deep-research)
  91. ### Cloudflare
  92. Currently the project supports deployment to Cloudflare, but you need to follow [How to deploy to Cloudflare Pages](./docs/How-to-deploy-to-Cloudflare-Pages.md) to do it.
  93. ### Docker
  94. > The Docker version needs to be 20 or above, otherwise it will prompt that the image cannot be found.
  95. > ⚠️ Note: Most of the time, the docker version will lag behind the latest version by 1 to 2 days, so the "update exists" prompt will continue to appear after deployment, which is normal.
  96. ```bash
  97. docker pull xiangfa/deep-research:latest
  98. docker run -d --name deep-research -p 3333:3000 xiangfa/deep-research
  99. ```
  100. You can also specify additional environment variables:
  101. ```bash
  102. docker run -d --name deep-research \
  103. -p 3333:3000 \
  104. -e ACCESS_PASSWORD=your-password \
  105. -e GOOGLE_GENERATIVE_AI_API_KEY=AIzaSy... \
  106. xiangfa/deep-research
  107. ```
  108. or build your own docker image:
  109. ```bash
  110. docker build -t deep-research .
  111. docker run -d --name deep-research -p 3333:3000 deep-research
  112. ```
  113. If you need to specify other environment variables, please add `-e key=value` to the above command to specify it.
  114. Deploy using `docker-compose.yml`:
  115. ```bash
  116. version: '3.9'
  117. services:
  118. deep-research:
  119. image: xiangfa/deep-research
  120. container_name: deep-research
  121. environment:
  122. - ACCESS_PASSWORD=your-password
  123. - GOOGLE_GENERATIVE_AI_API_KEY=AIzaSy...
  124. ports:
  125. - 3333:3000
  126. ```
  127. or build your own docker compose:
  128. ```bash
  129. docker compose -f docker-compose.yml build
  130. ```
  131. ### Static Deployment
  132. You can also build a static page version directly, and then upload all files in the `out` directory to any website service that supports static pages, such as Github Page, Cloudflare, Vercel, etc..
  133. ```bash
  134. pnpm build:export
  135. ```
  136. ## ⚙️ Configuration
  137. As mentioned in the "Getting Started" section, Deep Research utilizes the following environment variables for server-side API configurations:
  138. Please refer to the file [env.tpl](./env.tpl) for all available environment variables.
  139. **Important Notes on Environment Variables:**
  140. - **Privacy Reminder:** These environment variables are primarily used for **server-side API calls**. When using the **local API mode**, no API keys or server-side configurations are needed, further enhancing your privacy.
  141. - **Multi-key Support:** Supports multiple keys, each key is separated by `,`, i.e. `key1,key2,key3`.
  142. - **Security Setting:** By setting `ACCESS_PASSWORD`, you can better protect the security of the server API.
  143. - **Make variables effective:** After adding or modifying this environment variable, please redeploy the project for the changes to take effect.
  144. ## 📄 API documentation
  145. Currently the project supports two forms of API: Server-Sent Events (SSE) and Model Context Protocol (MCP).
  146. ### Server-Sent Events API
  147. The Deep Research API provides a real-time interface for initiating and monitoring complex research tasks.
  148. Recommended to use the API via `@microsoft/fetch-event-source`, to get the final report, you need to listen to the `message` event, the data will be returned in the form of a text stream.
  149. #### POST method
  150. Endpoint: `/api/sse`
  151. Method: `POST`
  152. Body:
  153. ```typescript
  154. interface SSEConfig {
  155. // Research topic
  156. query: string;
  157. // AI provider, Possible values ​​include: google, openai, anthropic, deepseek, atlascloud, xai, mistral, azure, openrouter, openaicompatible, pollinations, ollama
  158. provider: string;
  159. // Thinking model id
  160. thinkingModel: string;
  161. // Task model id
  162. taskModel: string;
  163. // Search provider, Possible values ​​include: model, tavily, firecrawl, crw, exa, bocha, searxng
  164. searchProvider: string;
  165. // Response Language, also affects the search language. (optional)
  166. language?: string;
  167. // Maximum number of search results. Default, `5` (optional)
  168. maxResult?: number;
  169. // Whether to include content-related images in the final report. Default, `true`. (optional)
  170. enableCitationImage?: boolean;
  171. // Whether to include citation links in search results and final reports. Default, `true`. (optional)
  172. enableReferences?: boolean;
  173. }
  174. ```
  175. Headers:
  176. ```typescript
  177. interface Headers {
  178. "Content-Type": "application/json";
  179. // If you set an access password
  180. // Authorization: "Bearer YOUR_ACCESS_PASSWORD";
  181. }
  182. ```
  183. See the detailed [API documentation](./docs/deep-research-api-doc.md).
  184. #### GET method
  185. This is an interesting implementation. You can watch the whole process of deep research directly through the URL just like watching a video.
  186. You can access the deep research report via the following link:
  187. ```text
  188. http://localhost:3000/api/sse/live?query=AI+trends+for+this+year&provider=pollinations&thinkingModel=openai&taskModel=openai-fast&searchProvider=searxng
  189. ```
  190. Query Params:
  191. ```typescript
  192. // The parameters are the same as POST parameters
  193. interface QueryParams extends SSEConfig {
  194. // If you set the `ACCESS_PASSWORD` environment variable, this parameter is required
  195. password?: string;
  196. }
  197. ```
  198. ### Model Context Protocol (MCP) Server
  199. Currently supports `StreamableHTTP` and `SSE` Server Transport.
  200. StreamableHTTP server endpoint: `/api/mcp`, transport type: `streamable-http`
  201. SSE server endpoint: `/api/mcp/sse`, transport type: `sse`
  202. ```json
  203. {
  204. "mcpServers": {
  205. "deep-research": {
  206. "url": "http://127.0.0.1:3000/api/mcp",
  207. "transportType": "streamable-http",
  208. "timeout": 600
  209. }
  210. }
  211. }
  212. ```
  213. **Note:** Since deep research take a long time to execute, you need to set a longer timeout to avoid interrupting the study.
  214. If your server sets `ACCESS_PASSWORD`, the MCP service will be protected and you need to add additional headers parameters:
  215. ```json
  216. {
  217. "mcpServers": {
  218. "deep-research": {
  219. "url": "http://127.0.0.1:3000/api/mcp",
  220. "transportType": "streamable-http",
  221. "timeout": 600,
  222. "headers": {
  223. "Authorization": "Bearer YOUR_ACCESS_PASSWORD"
  224. }
  225. }
  226. }
  227. }
  228. ```
  229. **Enabling MCP service requires setting global environment variables:**
  230. ```bash
  231. # MCP Server AI provider
  232. # Possible values ​​include: google, openai, anthropic, deepseek, atlascloud, xai, mistral, azure, openrouter, openaicompatible, pollinations, ollama
  233. MCP_AI_PROVIDER=google
  234. # MCP Server search provider. Default, `model`
  235. # Possible values ​​include: model, tavily, firecrawl, crw, exa, bocha, searxng
  236. MCP_SEARCH_PROVIDER=tavily
  237. # MCP Server thinking model id, the core model used in deep research.
  238. MCP_THINKING_MODEL=gemini-2.0-flash-thinking-exp
  239. # MCP Server task model id, used for secondary tasks, high output models are recommended.
  240. MCP_TASK_MODEL=gemini-2.0-flash-exp
  241. ```
  242. **Note:** To ensure that the MCP service can be used normally, you need to set the environment variables of the corresponding model and search engine. For specific environment variable parameters, please refer to [env.tpl](./env.tpl).
  243. ## 🪄 How it works
  244. 1. **Research topic**
  245. - Input research topic
  246. - Use local research resources (optional)
  247. - Start thinking (or rethinking)
  248. 2. **Propose your ideas**
  249. - The system asks questions
  250. - Answer system questions (optional)
  251. - Write a research plan (or rewrite the research plan)
  252. - The system outputs the research plan
  253. - Start in-depth research (or re-research)
  254. - The system generates SERP queries
  255. 3. **Information collection**
  256. - Initial research
  257. - Retrieve local research resources based on SERP queries
  258. - Collect information from the Internet based on SERP queries
  259. - In-depth research (this process can be repeated)
  260. - Propose research suggestions (optional)
  261. - Start a new round of information collection (the process is the same as the initial research)
  262. 4. **Generate Final Report**
  263. - Make a writing request (optional)
  264. - Summarize all research materials into a comprehensive Markdown report
  265. - Regenerate research report (optional)
  266. ```mermaid
  267. flowchart TB
  268. A[Research Topic]:::start
  269. subgraph Propose[Propose your ideas]
  270. B1[System asks questions]:::process
  271. B2[System outputs the research plan]:::process
  272. B3[System generates SERP queries]:::process
  273. B1 --> B2
  274. B2 --> B3
  275. end
  276. subgraph Collect[Information collection]
  277. C1[Initial research]:::collection
  278. C1a[Retrieve local research resources based on SERP queries]:::collection
  279. C1b[Collect information from the Internet based on SERP queries]:::collection
  280. C2[In-depth research]:::recursive
  281. Refine{More in-depth research needed?}:::decision
  282. C1 --> C1a
  283. C1 --> C1b
  284. C1a --> C2
  285. C1b --> C2
  286. C2 --> Refine
  287. Refine -->|Yes| C2
  288. end
  289. Report[Generate Final Report]:::output
  290. A --> Propose
  291. B3 --> C1
  292. %% Connect the exit from the loop/subgraph to the final report
  293. Refine -->|No| Report
  294. %% Styling
  295. classDef start fill:#7bed9f,stroke:#2ed573,color:black
  296. classDef process fill:#70a1ff,stroke:#1e90ff,color:black
  297. classDef recursive fill:#ffa502,stroke:#ff7f50,color:black
  298. classDef output fill:#ff4757,stroke:#ff6b81,color:black
  299. classDef collection fill:#a8e6cf,stroke:#3b7a57,color:black
  300. classDef decision fill:#c8d6e5,stroke:#8395a7,color:black
  301. class A start
  302. class B1,B2,B3 process
  303. class C1,C1a,C1b collection
  304. class C2 recursive
  305. class Refine decision
  306. class Report output
  307. ```
  308. ## 🙋 FAQs
  309. **Why does my Ollama or SearXNG not work properly and displays the error `TypeError: Failed to fetch`?**
  310. If your request generates `CORS` due to browser security restrictions, you need to configure parameters for Ollama or SearXNG to allow cross-domain requests. You can also consider using the server proxy mode, which is a backend server that makes requests, which can effectively avoid cross-domain issues.
  311. ## 🛡️ Privacy
  312. Deep Research is designed with your privacy in mind. **All research data and generated reports are stored locally on your machine.** We do not collect or transmit any of your research data to external servers (unless you are explicitly using server-side API calls, in which case data is sent to API through your configured proxy if any). Your privacy is our priority.
  313. ## 🙏 Acknowledgements
  314. - [Next.js](https://nextjs.org/) - The React framework for building performant web applications.
  315. - [Shadcn UI](https://ui.shadcn.com/) - Beautifully designed components that helped streamline the UI development.
  316. - [AI SDKs](https://sdk.vercel.ai) - Powering the intelligent research capabilities of Deep Research.
  317. - [Deep Research](https://github.com/dzhng/deep-research) - Thanks to the project `dzhng/deep-research` for inspiration.
  318. ## 🤝 Contributing
  319. We welcome contributions to Deep Research! If you have ideas for improvements, bug fixes, or new features, please feel free to:
  320. 1. Fork the repository.
  321. 2. Create a new branch for your feature or bug fix.
  322. 3. Make your changes and commit them.
  323. 4. Submit a pull request.
  324. For major changes, please open an issue first to discuss your proposed changes.
  325. ## ✉️ Contact
  326. If you have any questions, suggestions, or feedback, please create a new [issue](https://github.com/u14app/deep-research/issues).
  327. ## 📝 License
  328. Deep Research is released under the [MIT License](LICENSE). This license allows for free use, modification, and distribution for both commercial and non-commercial purposes.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.