README.md
November 22, 2025 Β· View on GitHub
π¬ Doc Research
Your Daily Paper Copilot - URLs or Files In, Multimodal Report Out
Features
- π Deep Document Research - Support deep analysis and summarization of documents
- π Multiple Input Types - Support multi-file uploads and URL inputs, including PDF, TXT, PPT, DOCX, etc.
- π Multimodal Reports - Support text and image reports in Markdown format
- π High Efficiency - Leverage powerful LLMs for fast and accurate research, leveraging key information extraction techniques to further optimize token usage
- βοΈ Flexible Deployment - Support local run and ModelScope Studio on both CPU and GPU environments.
- π° Free Model Inference - Free LLM API inference calls for ModelScope users, refer to ModelScope API-Inference
- π Export & Upload - Support exporting research reports to PDF, PPTX, DOCX, HTML formats; support uploading reports to ModelScope, HuggingFace, GitHub
Demo
ModelScope Studio
Reference Link: DocResearchStudio
Local Gradio Application
- Research Report for UniME: Breaking the Modality Barrier: Universal Embedding Learning with Multimodal LLMs
Demo: UniME Research Report
Installation and Running
1. Install Dependencies
conda create -n doc_research python=3.11
conda activate doc_research
# Version requirement: ms-agent>=1.1.0
pip install 'ms-agent[research]'
2. Configure Environment Variables
Free API Inference Calls - Every registered ModelScope user receives a set number of free API inference calls daily, refer to ModelScope API-Inference for details.
export OPENAI_API_KEY=xxx-xxx
export OPENAI_BASE_URL=https://api-inference.modelscope.cn/v1/
export OPENAI_MODEL_ID=Qwen/Qwen3-235B-A22B-Instruct-2507
OPENAI_API_KEY: (str), your API key, replacexxx-xxxwith your actual key. Alternatively, you can use ModelScope API key, refer to ModelScopeAccessTokenOPENAI_BASE_URL: (str), the base URL for API requests,https://api-inference.modelscope.cn/v1/for ModelScope API-InferenceOPENAI_MODEL_ID: (str), the model ID for inference,Qwen/Qwen3-235B-A22B-Instruct-2507can be recommended for document research tasks.
3. Run Application
Quick start:
# Use ms-agent CLI to run the app
ms-agent app --app_type doc_research
# Use Python script to run the app
cd ms-agent/app
python doc_research.py
Start with Parameters:
ms-agent app --app_type doc_research \
--server_name 0.0.0.0 \
--server_port 7860 \
--share
- Parameter Description:
server_name: (str), gradio server name, default:0.0.0.0
server_port: (int), gradio server port, default:7860
share: (store_true action), whether to share the app publicly.
- Notes
When running locally, the default address is http://0.0.0.0:7860/. If the page can't be accessed, try disabling proxy.
4. Report Export
DocResearch supports exporting markdown reports to various formats for easy archiving and sharing:
- PPTX
- HTML
- DOCX
Examples of exporting using Python script:
from ms_agent.utils.markdown_converter import MarkdownConverter
report_path: str = '/path/to/report_dir'
output_path: str = '/path/to/output_dir'
# Call export functions
MarkdownConverter.markdown_to_html(report_path, output_path + "/html")
MarkdownConverter.markdown_to_docx(report_path, output_path + "/docx")
MarkdownConverter.markdown_to_pptx(report_path, output_path + "/pptx")
MarkdownConverter.markdown_to_pdf(report_path, output_path + "/pdf")
5. Report Uploading & Sharing
DocResearch supports uploading generated markdown research reports to multiple platforms for easy sharing and collaboration:
- ModelScope
- HuggingFace
- GitHub
Upload to ModelScope:
from ms_agent.utils.push_to_hub import PushToModelScope
# Get the ModelScope tokenοΌ https://modelscope.cn/my/myaccesstoken
push_to_ms = PushToModelScope(token='ms-xxx')
push_to_ms.push(
repo_id='your-username/your-repo-name',
folder_path='/path/to/report_dir',
path_in_repo='report',
commit_message='Upload research report to ModelScope',
)
Upload to HuggingFace:
from ms_agent.utils.push_to_hub import PushToHuggingFace
# Get the HuggingFace tokenοΌ https://huggingface.co/settings/tokens
push_to_hf = PushToHuggingFace(token='hf_xxx')
push_to_hf.push(
repo_id='your-username/your-repo-name',
folder_path='/path/to/report_dir',
path_in_repo='report',
commit_message='Upload research report to HuggingFace',
)
Upload to GitHub:
from ms_agent.utils.push_to_hub import PushToGitHub
# Get the GitHub PAT(Personal Access Tokens): https://github.com/settings/tokens
push_to_git = PushToGitHub(
user_name = 'your-username',
repo_name = 'your-repo-name',
token = 'xxx',
visibility = 'public', # `public` or `private`
description = 'A repository for research reports generated by MS-Agent DocResearch',)
push_to_git.push(
folder_path='/path/to/report_dir',
path_in_repo='report',
commit_message='Upload research report to GitHub',
)
Usage Instructions
-
User Prompt - Enter your research objective or question in the text box
-
File Upload - Select files for analysis (supports multiple selections)
-
URLs Input - Enter relevant web links, one URL per line
-
Start Research - Click the run button to start the workflow
-
Research Report - View the execution results and research report in the right area (fullscreen available)
Working Directory Structure
Each run creates a new working directory under temp_workspace:
temp_workspace/user_xxx_1753706367955/
βββ task_20250728_203927_cc449ba9/
βββ task_20250729_143156_e5f6g7h8/
βββ resources/
βββ report.md
Cases
1. Single Document Research Report
-
User Prompt:
Deeply analyze and summarize the following document(Default) -
URLs Input:
https://arxiv.org/pdf/2504.17432 -
Research Report:
https://github.com/user-attachments/assets/706a5855-1188-4bdf-af39-5279b628571a
2. Multi-document Research Report
- User Prompt:
Compare Qwen3 and Qwen2.5, what optimizations are there? - URLs Input: (Enter the technical report links for Qwen3 and Qwen2.5 separately)
https://arxiv.org/abs/2505.09388
https://arxiv.org/abs/2412.15115
- Research Report:
https://github.com/user-attachments/assets/bba1bebd-20db-4297-864b-32ea5bb06a3c
Concurrency Control
Concurrency Limit
- Support up to 10 concurrent users executing research tasks by default
- Concurrency limit can be adjusted via environment variable
GRADIO_DEFAULT_CONCURRENCY_LIMIT - Users exceeding the concurrency limit will receive a system busy message
Status Monitoring
- Real-time display of system concurrency status: active tasks / maximum concurrency
- Display user task status: running, completed, failed, etc.
- Provides system status refresh functionality
User Isolation
- Each user has an independent working directory and session data
- In local mode, different sessions are distinguished by timestamps
- In remote mode, isolation is based on user ID
Notes
- Ensure sufficient disk space for temporary file storage
- Regularly clean the workspace to free up storage space
- Ensure normal network connection to access external URLs
- In high concurrency scenarios, it is recommended to appropriately increase server resource configuration