Skip to content

teguh407/deepresearch-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 DeepResearch Agent

Multi-agent long-chain reasoning system that turns any research question into a fully-cited PDF report.

Powered by Xiaomi MiMo · Built with Hermes Agent patterns

Python 3.11+ License: MIT MiMo Multi-Agent

🌐 Live demo: teguh407.github.io/deepresearch-agent


Why DeepResearch Agent?

Doing real research is painful. You search, lose tabs, copy quotes, forget sources, and end up with a hallucinated mess.

DeepResearch Agent solves this with a 5-agent pipeline that mimics how a human research team actually works:

Plan → Search → Verify → Synthesize → Write

Drop in a question. Get back a structured PDF with inline citations, source list, and a claim-by-claim confidence map. No hallucinated URLs. No forgotten sources.


✨ Features

  • 🧩 5 specialized agents — each with one job, coordinated by an orchestrator
  • 🔗 Long-chain reasoning — multi-step decomposition, not one giant prompt
  • 🔍 Real sources — arXiv + DuckDuckGo, scraped & quoted, never invented
  • Fact-checker layer — every claim re-verified against source text before it lands in the report
  • 📄 PDF output — clean typography, numbered citations, references page
  • 🔌 MiMo-native — uses Xiaomi MiMo as the reasoning engine (drop-in OpenAI-compatible)
  • 💾 Inspectable runs — every agent's input/output saved as JSON for audit

🏗️ Architecture

                       ┌─────────────────────┐
                       │   USER QUESTION     │
                       └──────────┬──────────┘
                                  │
                                  ▼
                       ┌─────────────────────┐
                       │  🗺️  PlannerAgent   │  decomposes question
                       │   (MiMo reasoning)  │  into sub-questions
                       └──────────┬──────────┘
                                  │
                ┌─────────────────┼─────────────────┐
                ▼                 ▼                 ▼
       ┌──────────────┐  ┌──────────────┐  ┌──────────────┐
       │ 🔎 Searcher  │  │ 🔎 Searcher  │  │ 🔎 Searcher  │
       │   (web)      │  │   (arXiv)    │  │   (web)      │
       └──────┬───────┘  └──────┬───────┘  └──────┬───────┘
              └─────────────────┼─────────────────┘
                                ▼
                       ┌─────────────────────┐
                       │ ✅ FactCheckerAgent │  drops unsupported
                       │   (MiMo verify)     │  claims
                       └──────────┬──────────┘
                                  │
                                  ▼
                       ┌─────────────────────┐
                       │ 🧬 SynthesizerAgent │  cross-refs sources,
                       │   (MiMo reasoning)  │  resolves conflicts
                       └──────────┬──────────┘
                                  │
                                  ▼
                       ┌─────────────────────┐
                       │ ✍️  WriterAgent     │  formats final
                       │   (MiMo + ReportLab)│  PDF + citations
                       └──────────┬──────────┘
                                  │
                                  ▼
                       ┌─────────────────────┐
                       │   📄 report.pdf     │
                       └─────────────────────┘

Each agent is a thin wrapper around an LLM call + a tool. They communicate through structured Pydantic messages and never share state directly.


🚀 Quickstart

1. Clone & install

git clone https://github.com/teguh407/deepresearch-agent.git
cd deepresearch-agent
python3.11 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

2. Get a MiMo API key

Sign up at platform.xiaomimimo.com and grab your API key.

cp .env.example .env
# Edit .env and paste your key:
# MIMO_API_KEY=sk-...

3. Run your first research

python -m src.main "What are the latest breakthroughs in retrieval-augmented generation in 2025?"

Output:

🧠 DeepResearch Agent v0.1.0

[1/5] 🗺️  Planning sub-questions ............ ✓ 6 sub-questions
[2/5] 🔎 Searching sources .................. ✓ 23 sources
[3/5] ✅ Fact-checking claims ............... ✓ 18/23 verified
[4/5] 🧬 Synthesizing findings .............. ✓
[5/5] ✍️  Writing report .................... ✓

📄 Report saved → out/report-20260518-1432.pdf
📊 Run trace   → out/trace-20260518-1432.json

📦 Project Structure

deepresearch-agent/
├── src/
│   ├── main.py              # CLI entrypoint
│   ├── orchestrator.py      # multi-agent coordinator
│   ├── config.py            # settings + MiMo client
│   ├── agents/
│   │   ├── base.py          # BaseAgent (LLM call + retries)
│   │   ├── planner.py       # decomposes question
│   │   ├── searcher.py      # web + arXiv search
│   │   ├── fact_checker.py  # verifies claims
│   │   ├── synthesizer.py   # cross-references sources
│   │   └── writer.py        # builds PDF
│   └── tools/
│       ├── web_search.py    # DuckDuckGo HTML scrape
│       ├── arxiv_search.py  # arXiv API
│       └── pdf_export.py    # ReportLab PDF builder
├── examples/
│   └── demo_run.py          # end-to-end example
├── tests/
│   └── test_agents.py
├── requirements.txt
├── .env.example
└── README.md

🧪 Example: Real Run

python -m src.main "How does Mixture-of-Experts compare to dense models for inference cost?"

Generates a 4-page PDF like:

1. Introduction Mixture-of-Experts (MoE) architectures activate a subset of parameters per token, theoretically reducing compute [1]. Recent work shows...

2. Findings 2.1 MoE inference cost is bounded by routing overhead [2]...

References [1] Fedus et al. Switch Transformers. arXiv:2101.03961 [2] DeepSeek-AI. DeepSeek-V3 Technical Report. 2024 ...

Every citation links back to a real source the agent actually read.


🛠️ Configuration

All knobs live in .env:

MIMO_API_KEY=sk-...
MIMO_MODEL=mimo-pro                 # or mimo-reasoner-v2 for harder questions
MIMO_BASE_URL=https://platform.xiaomimimo.com/v1

MAX_SUB_QUESTIONS=6                 # planner output cap
MAX_SOURCES_PER_QUERY=5             # searcher cap
ENABLE_ARXIV=true
ENABLE_WEB=true
OUTPUT_DIR=./out

🧠 Why MiMo?

The system was built and tuned against Xiaomi MiMo V2.5:

  • mimo-pro for planning, synthesis, and writing — strong long-context reasoning at low cost
  • mimo-reasoner-v2 as an optional upgrade for fact-checking when claims need deep verification

Drop-in OpenAI-compatible endpoint means you can also run with Claude / GPT for benchmarking, but the default mimo-pro config is the recommended path.


🗺️ Roadmap

  • 5-agent pipeline
  • arXiv + web search
  • PDF export with citations
  • Run-trace JSON for audit
  • Streaming progress over WebSocket
  • Web UI (Next.js)
  • Vector store for cross-report knowledge retention
  • Multi-language reports (CN / ID)
  • Telegram bot delivery

🤝 Contributing

PRs welcome. Run pytest before opening one. Style: ruff format.


📜 License

MIT — see LICENSE.


🙏 Acknowledgements

  • Xiaomi MiMo — the reasoning engine powering every agent
  • Hermes Agent — multi-agent patterns and skill system
  • arXiv — the open scientific record that makes this possible

About

Multi-agent long-chain reasoning research system. Plan → Search → Verify → Synthesize → Write. Powered by Xiaomi MiMo.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages