This repository provides a paper retrieval and analysis system with three completed phases:
- Plan 1: MCP infrastructure decoupling.
- Plan 2: ReAct agent with dynamic tool routing.
- Plan 3: Multi-agent architecture (Researcher -> Vision Expert -> Writer).
All 3 plans are completed and integrated.
This project uses conda environment pr.
conda activate pr
python -m pip install -r requirements.txtIf needed, use a fixed interpreter path:
C:/Users/lenovo/anaconda3/envs/pr/python.exe main.py --help- MCP server entry:
mcp_server.py - Server name:
PaperBrain - Exposed MCP tools include:
search_arxiv_toolsearch_dblp_tooldownload_and_extract_captions_toolcrop_figure_tool
Run MCP server:
C:/Users/lenovo/anaconda3/envs/pr/python.exe mcp_server.py- Runtime core:
agent_runner.py - Main entry:
main.py - ReAct builds on
create_react_agentwithALL_TOOLS - Streaming logs include Thought / Action / Observation / Final Answer
- State:
workflow/multi_agent_state.py - Nodes:
workflow/multi_agent_nodes.py - Graph:
workflow/multi_agent_graph.py - Runtime handoff logs:
[Researcher Agent working...][Vision Expert Agent working...][Writer Agent working...]
Main program entry is main.py.
C:/Users/lenovo/anaconda3/envs/pr/python.exe main.py [ARGS]C:/Users/lenovo/anaconda3/envs/pr/python.exe main.py --query "Search arXiv for recent vision-language model papers from the last 3 days"C:/Users/lenovo/anaconda3/envs/pr/python.exe main.py --mode multi-agent --query "Search arXiv for Vision-Language Models and Hallucination papers from last 3 days, then create a concise report"The current behavior is:
- Local intent is local-only.
- For local queries, remote retrieval tools are disabled in ReAct mode.
- In multi-agent mode, local intent processes local PDFs directly.
- Remote retrieval is used when query intent is arXiv/DBLP/online retrieval.
- Both modes still support report generation after analysis.
Local query example:
C:/Users/lenovo/anaconda3/envs/pr/python.exe main.py --query "Analyze local PDFs under paper folder about Vision-Language Models and training-free, then generate one markdown report named react_local_training_free.md"Remote query examples:
C:/Users/lenovo/anaconda3/envs/pr/python.exe main.py --query "Search arXiv for recent Vision-Language Model papers from last 3 days, download the first one, analyze it, and generate one markdown report named arxiv_mode_report.md"
C:/Users/lenovo/anaconda3/envs/pr/python.exe main.py --query "Find CVPR 2025 papers from DBLP, download the first available PDF, analyze it with keywords Vision-Language Models and Hallucination, and generate one markdown report named dblp_mode_report.md"- Markdown reports are written to
output/ - Extracted/cropped figures are written to
output/images/
Run unit tests:
C:/Users/lenovo/anaconda3/envs/pr/python.exe -m unittest discover -s tests -vRecent validation confirms tests pass in conda environment pr.