MCPcopy Index your code
hub / github.com/u14app/deep-research

github.com/u14app/deep-research @v0.11.0 sqlite

repository ↗ · DeepWiki ↗ · release v0.11.0 ↗
4,327 symbols 10,852 edges 134 files 56 documented · 1%
README

Deep Research

GitHub deployments GitHub Release Docker Image Size Docker Pulls License: MIT

Gemini Next Tailwind CSS shadcn/ui

Vercel Cloudflare PWA

Ask DeepWiki

Lightning-Fast Deep Research Report

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.

✨ Features

  • Rapid Deep Research: Generates comprehensive research reports in about 2 minutes, significantly accelerating your research process.
  • Multi-platform Support: Supports rapid deployment to Vercel, Cloudflare and other platforms.
  • Powered by AI: Utilizes the advanced AI models for accurate and insightful analysis.
  • Privacy-Focused: Your data remains private and secure, as all data is stored locally on your browser.
  • Support for Multi-LLM: Supports a variety of mainstream large language models, including Gemini, OpenAI, Anthropic, Deepseek, Grok, Mistral, Azure OpenAI, any OpenAI Compatible LLMs, OpenRouter, Ollama, etc.
  • Support Web Search: Supports search engines such as Searxng, Tavily, Firecrawl, Exa, Bocha, Brave, etc., allowing LLMs that do not support search to use the web search function more conveniently.
  • Thinking & Task Models: Employs sophisticated "Thinking" and "Task" models to balance depth and speed, ensuring high-quality results quickly. Support switching research models.
  • Support Further Research: You can refine or adjust the research content at any stage of the project and support re-research from that stage.
  • Local Knowledge Base: Supports uploading and processing text, Office, PDF and other resource files to generate local knowledge base.
  • 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.
  • Knowledge Graph: It supports one-click generation of knowledge graph, allowing you to have a systematic understanding of the report content.
  • Research History: Support preservation of research history, you can review previous research results at any time and conduct in-depth research again.
  • Local & Server API Support: Offers flexibility with both local and server-side API calling options to suit your needs.
  • 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.
  • Support PWA: With Progressive Web App (PWA) technology, you can use the project like a software.
  • Support Multi-Key payload: Support Multi-Key payload to improve API response efficiency.
  • Multi-language Support: English, 简体中文, Español.
  • Built with Modern Technologies: Developed using Next.js 15 and Shadcn UI, ensuring a modern, performant, and visually appealing user experience.
  • MIT Licensed: Open-source and freely available for personal and commercial use under the MIT License.

🎯 Roadmap

  • [x] Support preservation of research history
  • [x] Support editing final report and search results
  • [x] Support for other LLM models
  • [x] Support file upload and local knowledge base
  • [x] Support SSE API and MCP server

🚀 Getting Started

Use Free Gemini (recommend)

  1. Get Gemini API Key
  2. One-click deployment of the project, you can choose to deploy to Vercel or Cloudflare

Deploy with Vercel

Currently the project supports deployment to Cloudflare, but you need to follow How to deploy to Cloudflare Pages to do it.

  1. Start using

Use Other LLM

  1. Deploy the project to Vercel or Cloudflare
  2. Set the LLM API key
  3. Set the LLM API base URL (optional)
  4. Start using

⌨️ Development

Follow these steps to get Deep Research up and running on your local browser.

Prerequisites

Installation

  1. Clone the repository:

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

  1. Install dependencies:

bash pnpm install # or npm install or yarn install

  1. 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.

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

  1. Run the development server:

bash pnpm dev # or npm run dev or yarn dev

Open your browser and visit http://localhost:3000 to access Deep Research.

Custom Model List

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.

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.

🚢 Deployment

Vercel

Deploy with Vercel

Cloudflare

Currently the project supports deployment to Cloudflare, but you need to follow How to deploy to Cloudflare Pages to do it.

Docker

The Docker version needs to be 20 or above, otherwise it will prompt that the image cannot be found.

⚠️ 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.

docker pull xiangfa/deep-research:latest
docker run -d --name deep-research -p 3333:3000 xiangfa/deep-research

You can also specify additional environment variables:

docker run -d --name deep-research \
   -p 3333:3000 \
   -e ACCESS_PASSWORD=your-password \
   -e GOOGLE_GENERATIVE_AI_API_KEY=AIzaSy... \
   xiangfa/deep-research

or build your own docker image:

docker build -t deep-research .
docker run -d --name deep-research -p 3333:3000 deep-research

If you need to specify other environment variables, please add -e key=value to the above command to specify it.

Deploy using docker-compose.yml:

version: '3.9'
services:
   deep-research:
      image: xiangfa/deep-research
      container_name: deep-research
      environment:
         - ACCESS_PASSWORD=your-password
         - GOOGLE_GENERATIVE_AI_API_KEY=AIzaSy...
      ports:
         - 3333:3000

or build your own docker compose:

docker compose -f docker-compose.yml build

Static Deployment

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..

pnpm build:export

⚙️ Configuration

As mentioned in the "Getting Started" section, Deep Research utilizes the following environment variables for server-side API configurations:

Please refer to the file env.tpl for all available environment variables.

Important Notes on Environment Variables:

  • 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.

  • Multi-key Support: Supports multiple keys, each key is separated by ,, i.e. key1,key2,key3.

  • Security Setting: By setting ACCESS_PASSWORD, you can better protect the security of the server API.

  • Make variables effective: After adding or modifying this environment variable, please redeploy the project for the changes to take effect.

📄 API documentation

Currently the project supports two forms of API: Server-Sent Events (SSE) and Model Context Protocol (MCP).

Server-Sent Events API

The Deep Research API provides a real-time interface for initiating and monitoring complex research tasks.

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.

POST method

Endpoint: /api/sse

Method: POST

Body:

interface SSEConfig {
  // Research topic
  query: string;
  // AI provider, Possible values ​​include: google, openai, anthropic, deepseek, xai, mistral, azure, openrouter, openaicompatible, pollinations, ollama
  provider: string;
  // Thinking model id
  thinkingModel: string;
  // Task model id
  taskModel: string;
  // Search provider, Possible values ​​include: model, tavily, firecrawl, exa, bocha, searxng
  searchProvider: string;
  // Response Language, also affects the search language. (optional)
  language?: string;
  // Maximum number of search results. Default, `5` (optional)
  maxResult?: number;
  // Whether to include content-related images in the final report. Default, `true`. (optional)
  enableCitationImage?: boolean;
  // Whether to include citation links in search results and final reports. Default, `true`. (optional)
  enableReferences?: boolean;
}

Headers:

interface Headers {
  "Content-Type": "application/json";
  // If you set an access password
  // Authorization: "Bearer YOUR_ACCESS_PASSWORD";
}

See the detailed API documentation.

GET method

This is an interesting implementation. You can watch the whole process of deep research directly through the URL just like watching a video.

You can access the deep research report via the following link:

http://localhost:3000/api/sse/live?query=AI+trends+for+this+year&provider=pollinations&thinkingModel=openai&taskModel=openai-fast&searchProvider=searxng

Query Params:

// The parameters are the same as POST parameters
interface QueryParams extends SSEConfig {
  // If you set the `ACCESS_PASSWORD` environment variable, this parameter is required
  password?: string;
}

Model Context Protocol (MCP) Server

Currently supports StreamableHTTP and SSE Server Transport.

StreamableHTTP server endpoint: /api/mcp, transport type: streamable-http

SSE server endpoint: /api/mcp/sse, transport type: sse

{
  "mcpServers": {
    "deep-research": {
      "url": "http://127.0.0.1:3000/api/mcp",
      "transportType": "streamable-http",
      "timeout": 600
    }
  }
}

Note: Since deep research take a long time to execute, you need to set a longer timeout to avoid interrupting the study.

If your server sets ACCESS_PASSWORD, the MCP service will be protected and you need to add additional headers parameters:

{
  "mcpServers": {
    "deep-research": {
      "url": "http://127.0.0.1:3000/api/mcp",
      "transportType": "streamable-http",
      "timeout": 600,
      "headers": {
        "Authorization": "Bearer YOUR_ACCESS_PASSWORD"
      }
    }
  }
}

Enabling MCP service requires setting global environment variables:

# MCP Server AI provider
# Possible values ​​include: google, openai, anthropic, deepseek, xai, mistral, azure, openrouter, openaicompatible, pollinations, ollama
MCP_AI_PROVIDER=google
# MCP Server search provider. Default, `model`
# Possible values ​​include: model, tavily, firecrawl, exa, bocha, searxng
MCP_SEARCH_PROVIDER=tavily
# MCP Server thinking model id, the core model used in deep research.
MCP_THINKING_MODEL=gemini-2.0-flash-thinking-exp
# MCP Server task model id, used for secondary tasks, high output models are recommended.
MCP_TASK_MODEL=gemini-2.0-flash-exp

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 environme

Extension points exported contracts — how you extend this code

Transport (Interface)
(no doc) [4 implementers]
src/libs/mcp-server/shared/transport.ts
ExtractedFiles (Interface)
* Resolves to an array of object
src/utils/parser/officeParser.ts
Resource (Interface)
(no doc)
src/types.d.ts
HistoryProps (Interface)
(no doc)
src/components/History.tsx
GlobalStore (Interface)
(no doc)
src/store/global.ts
WorkerGlobalScope (Interface)
(no doc)
src/app/sw.ts
GeminiModel (Interface)
(no doc)
src/hooks/useModelList.ts
CompletableDef (Interface)
(no doc)
src/libs/mcp-server/completable.ts

Core symbols most depended-on inside this repo

push
called by 954
public/scripts/pdf.worker.min.mjs
get
called by 856
public/scripts/pdf.worker.min.mjs
set
called by 526
public/scripts/pdf.worker.min.mjs
warn
called by 268
public/scripts/pdf.worker.min.mjs
map
called by 222
public/scripts/pdf.worker.min.mjs
on
called by 214
public/scripts/pdf.worker.min.mjs
find
called by 175
public/scripts/pdf.worker.min.mjs
has
called by 174
public/scripts/pdf.worker.min.mjs

Shape

Method 2,366
Class 1,149
Function 760
Interface 50
Enum 2

Languages

TypeScript100%

Modules by API surface

public/scripts/pdf.worker.min.mjs3,700 symbols
public/scripts/eruda.min.js122 symbols
src/libs/mcp-server/mcp.ts49 symbols
src/libs/mcp-server/shared/protocol.ts24 symbols
src/utils/parser/officeParser.ts23 symbols
src/libs/mcp-server/streamableHttp.ts19 symbols
src/hooks/useDeepResearch.ts19 symbols
src/utils/deep-research/index.ts18 symbols
src/libs/mcp-server/shared/uriTemplate.ts16 symbols
src/components/Research/SearchResult.tsx16 symbols
src/utils/deep-research/prompts.ts13 symbols
src/utils/model.ts12 symbols

Dependencies from manifests, versioned

@ai-sdk/anthropic1.2.10 · 1×
@ai-sdk/azure1.3.23 · 1×
@ai-sdk/deepseek0.2.13 · 1×
@ai-sdk/google1.2.14 · 1×
@ai-sdk/google-vertex2.2.27 · 1×
@ai-sdk/mistral1.2.8 · 1×
@ai-sdk/openai1.3.21 · 1×
@ai-sdk/openai-compatible0.2.14 · 1×
@ai-sdk/ui-utils1.2.9 · 1×
@ai-sdk/xai1.2.15 · 1×
@eslint/eslintrc3 · 1×
@hookform/resolvers4.1.2 · 1×

For agents

$ claude mcp add deep-research \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact