Build any agentic RAG with depth x width
In 2025, we observed three critical trends reshaping the Retrieval-Augmented Generation (RAG) tech stacks:
-
Traditional, Rigid, pipeline-driven RAG is giving way to more dynamic agentic RAG systems.
-
The emergence of MCP is dramatically lowering the complexity of developing enterprise-grade Agentic RAG.
-
Developers desperately need to customize and balance response time, the breadth of information retrieval, and cost. However, most agent solution ignore this critical requirement.
Based on these trends, the market needs a single, open-source RAG agent that is MCP-compatible and offers granular control over performance, scope, and cost.
We built Open Deep Wide Research to be that solution, providing one agent for all RAG scenarios. Its core is the "Deep/Wide" coordinate system, which gives you the control you need:
- Deep: Controls response time and reasoning depth.
- Wide: Controls information breadth from various sources.
- Deep × Wide: Predicts the cost of a single agentic RAG response.
Deep
(Reasoning
Depth)
10 ┤ 🎯 Ultra Deep Dive
│ Time: 5-10 min
9 ┤ Cost: $1.50-5.00
│
8 ┤ 📊 Deep Analysis 📈 Comprehensive Report
│ Time: 1-2 min Time: 2-5 min
7 ┤ Cost: $0.20-0.50 Cost: $0.50-1.50
│
6 ┤
│
5 ┤ ⚖️ Balanced Research
│ Time: 30-60s Cost: $0.20
4 ┤
│
3 ┤
│
2 ┤ 💬 Quick Chat 🔍 Wide Survey
│ Time: 5-10s Time: 30-90s
1 ┤ Cost: $0.01-0.05 Cost: $0.30-0.60
│
0 └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴────→
0 1 2 3 4 5 6 7 8 9 10
Wide (Information Breadth)
Choose Your Scenario:
| Quadrant | Scenario | Deep | Wide | Use Case | Response | Cost |
|---|---|---|---|---|---|---|
| Lower Left | 💬 Quick Chat | Low | Low | Simple Q&A, casual chat | ~10s | $0.01 |
| Lower Right | 🔍 Wide Survey | Low | High | Market research, trends | ~1min | $0.30 |
| Upper Left | 📊 Deep Analysis | High | Low | Technical analysis | ~2min | $0.20 |
| Upper Right | 📈 Comprehensive Report | High | High | Professional reports | ~5min | $1.00 |
| Center | ⚖️ Balanced Research | Med | Med | General research | ~1min | $0.20 |
💡 Pro Tip: Start with balanced settings (5,5) and adjust based on your needs. Cost scales predictably with Deep × Wide!
If this mission resonates with you, please give us a star ⭐ and fork it! 🤞
- Deep × Wide Control – Tune the depth of reasoning and breadth of information sources to perfectly match any RAG scenario, from quick chats to in-depth analysis.
- Predictable Cost Management – No more surprise bills. Cost is a transparent function of your Deep × Wide settings, giving you full control over your budget.
- MCP Protocol Native Support – Built on the Model Context Protocol for seamless integration with any compliant data source or tool, creating a truly extensible and future-proof agent.
- Self-Hosted for Maximum Privacy – Deploy on your own infrastructure to maintain absolute control over your data and meet the strictest security requirements.
- Hot‑Swappable Models – Plug in OpenAI, Claude, or your private LLM instantly.
- Customizable Search Engines – Integrate any search provider. Tavily and Exa supported out-of-the-box. As long as it supports MCP.
| Feature | |||||||
|---|---|---|---|---|---|---|---|
| Depth × width controls | D x W | × | × | W | × | D | × |
| Open source | ✅ | × | × | × | × | ✅ | ✅ |
| MCP support | ✅ | ✅ | × | × | × | ✅ | × |
| SDK / API | ✅ | ✅ | ✅ | × | × | ✅ | ✅ |
| Local knowledge | ✅ | × | × | × | × | ✅ | ✅ |
| Model flexibility | ✅ | × | × | × | × | × | ✅ |
| Search engine flexibility | ✅ | × | × | × | × | × | × |
| Performance | 5 | 5 | 4 | 3 | 4 | 4 | 3 |
Names are trademarks of their owners; descriptions are generalized and may change.
- Python 3.9+ and Node.js 18+
- API keys: Open Router (required), and Exa / Tavily (at least one)
- Recommended model: open-o4mini
- API-only (Backend): If you only need the Deep Research backend as an API to embed in your codebase, deploy the backend only.
- Full stack (Frontend + Backend): If you want the full experience with the web UI, deploy both the backend and the frontend.
- Copy the env template:
cp deep_wide_research/env.example deep_wide_research/.env- Edit the copied .env and set your keys:
# deep_wide_research/.env
OPENROUTER_API_KEY=your_key
# At least one of the following
EXA_API_KEY=your_exa_key
# or
TAVILY_API_KEY=your_tavily_keyYou can obtain the Tavily and Exa API keys from their official sites: Tavily and Exa.
- Set up the environment:
cd deep_wide_research
python -m venv deep-wide-research
source deep-wide-research/bin/activate
pip install -r requirements.txt- Start the backend server:
python main.py- Copy the env template:
cp chat_interface/env.example chat_interface/.env.local- Install dependencies and start the dev server:
cd chat_interface
npm install
npm run dev- Open the app:
Open http://localhost:3000 – Start researching in seconds.
docker-compose up -dThis project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
Copyright (c) 2025 PuppyAgent and contributors.

