MCPcopy Index your code
hub / github.com/RUC-NLPIR/WebThinker

github.com/RUC-NLPIR/WebThinker @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
446 symbols 1,651 edges 59 files 109 documented · 24%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🌐 WebThinker: Empowering Large Reasoning Models with Deep Research Capability

Notion Paper Paper License Python 3.9+ X (formerly Twitter) URL

🤗 WebThinker-QwQ-32B | 🤗 WebThinker-R1-7B | 🤗 WebThinker-R1-14B | 🤗 WebThinker-R1-32B

If you like our project, please give us a star ⭐ on GitHub for the latest update.

📣 Latest News

🔥 Deep Research Agent Family

Welcome to try our deep research agent series:

DeepAgent: A General Reasoning Agent with Scalable Toolsets (New!)

Authors: Xiaoxi Li, Wenxiang Jiao, Jiarui Jin, Guanting Dong, Jiajie Jin, Yinuo Wang, Hao Wang, Yutao Zhu, Ji-Rong Wen, Yuan Lu, Zhicheng Dou

TLDR: An end-to-end deep reasoning agent that performs autonomous thinking, tool discovery, and action execution with brain-inspired memory folding mechanism.

github github arXiv Paper

WebThinker: Empowering Large Reasoning Models with Deep Research Capability (NeurIPS 2025)

Authors: Xiaoxi Li, Jiajie Jin, Guanting Dong*, Hongjin Qian, Yutao Zhu, Yongkang Wu, Ji-Rong Wen, Zhicheng Dou

TLDR: A deep research agent that empowers large reasoning models with autonomous search, web browsing, and research report drafting capabilities.

github github arXiv Paper

Search-o1: Agentic Search-Enhanced Large Reasoning Models (EMNLP 2025)

Authors: Xiaoxi Li, Guanting Dong, Jiajie Jin, Yuyao Zhang, Yujia Zhou, Yutao Zhu, Peitian Zhang, Zhicheng Dou

TLDR: An agentic search-enhanced framework that integrates autonomous knowledge retrieval with large reasoning models through Agentic RAG and reasoning-in-documents modules.

github github arXiv Paper Project Page

🎬 Demo

<video src="https://github.com/user-attachments/assets/a38e82ec-5aed-4efe-a8b8-e9ee2d97e9b9" />

💡 Overview

WebThinker is a deep research framework fully powered by large reasoning models (LRMs). WebThinker enables LRMs to autonomously search, deeply explore web pages, and draft research reports, all within their thinking process.

Unlike existing open-source deep search agents that typically employ retrieval-augmented generation (RAG) with predefined workflows, WebThinker allows the reasoning model itself to perform actions during thinking, achieving end-to-end task execution in a single generation.

📊 Overall Performance

As shown above, WebThinker consistently outperforms competing approaches on both knowledge-intensive complex reasoning benchmarks (GPQA, GAIA, WebWalkerQA, HLE) and open-ended reasoning tasks for report generation. Our WebThinker-32B with QwQ-32B as backbone reasoning model achieves superior performance across all tasks.

✨ The WebThinker Framework

Model Comparison

WebThinker enables reasoning models to autonomously conduct web searches and web page navigations to acquire external knowledge during their reasoning process. This approach significantly reduces the time and costs associated with information gathering for researchers in knowledge-intensive fields. Furthermore, WebThinker allows LRMs to draft section content while thinking and searching, producing comprehensive, customized reports that directly address users' research questions.

Key Features: - We introduce a Deep Web Explorer that empowers LRMs to search, navigate pages by clicking interactive elements (like links or buttons), and extract relevant information. Based on initial search results, the LRM can initiate follow-up searches and traverse deeper links until it collects all relevant information. - For scientific reporting, our Autonomous Think-Search-and-Draft strategy integrates real-time knowledge seeking with report creation. We equip LRMs with three specialized tools: (1) drafting content for specific chapters, (2) checking the current report, and (3) editing the report—ensuring reports remain comprehensive, coherent, and adaptive to new insights. - We're developing RL-based training strategies to optimize end-to-end task performance by leveraging large-scale reasoning trajectories from complex tasks. Using accuracy of reasoning, tool usage, and final outputs, we construct preference pairs for online DPO training, enabling the model to progressively improve its research capabilities.

🔧 Installation

Environment Setup

# Create conda environment
conda create -n webthinker python=3.9
conda activate webthinker

# Install requirements
cd WebThinker-main
pip install -r requirements.txt

🏃 Quick Start

Pre-preparation

Model Serving

Before running WebThinker, ensure your reasoning model and auxiliary model are served using vLLM. In our experiments, we use QwQ-32B as the reasoning model and Qwen-32B-Instruct as the auxiliary model. You can also explore other instruction-tuned models as your auxiliary model, which will be used in webpage reading, report writting/editting, evaluation, etc. For detailed instructions on model serving, see here.

Web Parser Client

For better web crawling performance, we recommend setting up a web parser client in scripts/search/bing_search.py using Crawl4AI. This will help handle JavaScript-rendered content and provide more reliable webpage extraction.

Now you can run different inference modes using the provided scripts. Below are examples of how to execute each mode:

Problem Solving Mode

  1. If you would like to ask a single question, run the following command:
python scripts/run_web_thinker.py \
    --single_question "What is OpenAI Deep Research?" \
    --search_engine "serper" \
    --serper_api_key "YOUR_GOOGLE_SERPER_API" \
    --api_base_url "YOUR_API_BASE_URL" \
    --model_name "QwQ-32B" \
    --aux_api_base_url "YOUR_AUX_API_BASE_URL" \
    --aux_model_name "Qwen2.5-32B-Instruct" \
    --tokenizer_path "PATH_TO_YOUR_TOKENIZER" \
    --aux_tokenizer_path "PATH_TO_YOUR_AUX_TOKENIZER"
  1. If you would like to run results on benchmarks, run the following command:
python scripts/run_web_thinker.py \
    --dataset_name gaia \
    --split dev \
    --concurrent_limit 32 \
    --max_search_limit 15 \
    --search_engine "serper" \
    --serper_api_key "YOUR_GOOGLE_SERPER_API" \
    --api_base_url "YOUR_API_BASE_URL" \
    --model_name "QwQ-32B" \
    --aux_api_base_url "YOUR_AUX_API_BASE_URL" \
    --aux_model_name "Qwen2.5-32B-Instruct" \
    --tokenizer_path "PATH_TO_YOUR_TOKENIZER" \
    --aux_tokenizer_path "PATH_TO_YOUR_AUX_TOKENIZER"

Report Generation Mode

  1. If you would like to ask a single question, run the following command:
python scripts/run_web_thinker_report.py \
    --single_question "What are the models of OpenAI and what are the differences?" \
    --search_engine "serper" \
    --serper_api_key "YOUR_GOOGLE_SERPER_API" \
    --api_base_url "YOUR_API_BASE_URL" \
    --model_name "QwQ-32B" \
    --aux_api_base_url "YOUR_AUX_API_BASE_URL" \
    --aux_model_name "Qwen2.5-32B-Instruct" \
    --tokenizer_path "PATH_TO_YOUR_TOKENIZER" \
    --aux_tokenizer_path "PATH_TO_YOUR_AUX_TOKENIZER"
  1. If you would like to run results on benchmarks, run the following command:
python scripts/run_web_thinker_report.py \
    --dataset_name glaive \
    --split test \
    --concurrent_limit 32 \
    --search_engine "serper" \
    --serper_api_key "YOUR_GOOGLE_SERPER_API" \
    --api_base_url "YOUR_API_BASE_URL" \
    --model_name "QwQ-32B" \
    --aux_api_base_url "YOUR_AUX_API_BASE_URL" \
    --aux_model_name "Qwen2.5-32B-Instruct" \
    --tokenizer_path "PATH_TO_YOUR_TOKENIZER" \
    --aux_tokenizer_path "PATH_TO_YOUR_AUX_TOKENIZER"

Parameters Explanation: - --dataset_name: Name of the dataset to use (glaive). - --split: Data split to run (test). - --single_question: The question you want to ask when running in single question mode. - --concurrent_limit: Maximum number of concurrent requests. - --max_search_limit: Maximum number of search queries per reasoning session. - --search_engine: Search engine to use (bing or serper). Default: bing. - --serper_api_key: Your Google Serper API key (not required when using Bing). - --bing_subscription_key: Your Bing Search API subscription key (not required when using Serper). - --api_base_url: Base URL for the main model API. - --model_name: Name of the main model to use. - --aux_api_base_url: Base URL for the auxiliary model API. - --aux_model_name: Name of the auxiliary model to use.

Run Demo

You can run the demo we have created with the following command, and we will conduct in-depth exploration and thinking based on the questions you input.

cd demo
streamlit run_demo.py

Note: Before running, it is necessary to configure the relevant parameters in demo/settings.py.

Benchmarks

The benchmarks we utilize are categorized into two types: - Complex Reasoning Benchmarks: - PhD-level Science QA: GPQA (198 questions) - General AI Assistant: GAIA (103 questions) - Web Exploration: WebWalkerQA (680 questions) - Extremely Difficult Reasoning Problems: Humanity's Last Exam (HLE) (500 questions) - Scientific Report Evaluation: - General Open-ended Reasoning Problem: [Reasoning-v1-20m](htt

Core symbols most depended-on inside this repo

get_task_instruction_multi_choice
called by 26
scripts/prompts/prompts.py
get_task_instruction_openqa
called by 19
scripts/prompts/prompts.py
generate_response
called by 13
scripts/run_web_thinker_report.py
get_generic_question_template_answer
called by 12
scripts/lcb_runner/prompts/code_generation.py
get_task_instruction_math
called by 11
scripts/prompts/prompts.py
get_task_instruction_code
called by 10
scripts/prompts/prompts.py
extract_snippet_with_context
called by 9
scripts/search/bing_search.py
extract_relevant_info
called by 9
scripts/search/bing_search.py

Shape

Function 295
Method 105
Class 45
Route 1

Languages

Python100%

Modules by API surface

scripts/lcb_runner/pyext/pyext-0.7/pyext.py42 symbols
scripts/search/bing_search.py22 symbols
scripts/prompts/prompts.py20 symbols
demo/bing_search.py19 symbols
scripts/lcb_runner/evaluation/testing_util.py17 symbols
scripts/lcb_runner/evaluation/utils_execute.py15 symbols
demo/settings.py15 symbols
scripts/prompts/prompts_report.py14 symbols
scripts/lcb_runner/pyext/pyext-0.7/test/test_pyext.py14 symbols
scripts/lcb_runner/prompts/self_repair.py14 symbols
scripts/run_web_thinker_report.py13 symbols
scripts/lcb_runner/prompts/test_output_prediction.py13 symbols

For agents

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

⬇ download graph artifact