A sophisticated research tool powered by Minimax M2.1 with interleaved thinking, Exa neural search, and multi-agent orchestration.
- Minimax M2.1 Supervisor: Uses interleaved thinking to maintain reasoning state across multi-step research
- Intelligent Planning: Automatically decomposes research queries into optimized subqueries
- Neural Web Search: Leverages Exa API for high-quality, AI-powered web search
- Comprehensive Reports: Generates detailed research reports with citations and analysis
- CLI Interface: Simple command-line interface with interactive and single-query modes
+-----------------------------------------------+
| Supervisor Agent |
| (Minimax M2.1 + Interleaved Thinking) |
+-----------------------------------------------+
|
+--------------+--------------+
| | |
v v v
+------------+ +-------------+ +-----------+
| Planning | | Web Search | | Synthesis |
| Agent | | Retriever | | (M2.1) |
| (Gemini) | | | | |
+------------+ +-------------+ +-----------+
|
v
+------------+
| Exa API |
+------------+
| Agent | Model | Role |
|---|---|---|
| Supervisor | Minimax M2.1 | Coordinates workflow, synthesizes final report |
| Planning | Gemini 2.5 Flash | Generates optimized subqueries |
| Web Search | Gemini 2.5 Flash + Exa | Executes searches, organizes findings |
# Clone and setup
cd deep-research-agent
uv sync
# Configure API keys
cp .env.example .env
# Edit .env with your keys
# Run
uv run python main.py -q "Your research query here"- Python 3.12+
- uv package manager
- API keys for:
- Minimax (M2.1 model)
- OpenRouter (for Gemini)
- Exa (web search)
- Install dependencies:
cd deep-research-agent
uv sync- Configure environment variables:
cp .env.example .envEdit .env and add your API keys:
MINIMAX_API_KEY=your_minimax_api_key_here
OPENROUTER_API_KEY=your_openrouter_api_key_here
EXA_API_KEY=your_exa_api_key_here
uv run python main.pyThen enter your research queries at the prompt.
uv run python main.py -q "What are the latest developments in quantum computing?"uv run python main.py -q "AI trends in 2025" --saveuv run python main.py -q "Climate change solutions" --verbose| Option | Description |
|---|---|
-q, --query |
Research query (skips interactive mode) |
-s, --save |
Save report to reports/ folder |
-v, --verbose |
Show detailed progress and thinking blocks |
| Command | Description |
|---|---|
/save <query> |
Save the report to a file |
/verbose <query> |
Show detailed progress |
/help |
Show help message |
exit, quit, q |
Exit the program |
The Planning Agent decomposes your query into 3-5 optimized subqueries:
{
"subqueries": [
{"query": "quantum computing breakthroughs 2025", "type": "news", "priority": 1},
{"query": "quantum computing applications cryptography", "type": "auto", "priority": 2}
]
}The Web Search Retriever executes each subquery using Exa:
- Performs neural search for each subquery
- Finds similar content for high-priority results
- Extracts highlights and key information
The Supervisor Agent (Minimax M2.1):
- Maintains reasoning state via interleaved thinking
- Synthesizes comprehensive report with:
- Table of contents
- Key takeaways
- Executive summary
- Detailed analysis
- Cited sources
The key innovation: the supervisor preserves ALL content blocks (thinking + text + tool_use) in conversation history. This maintains the reasoning chain across multiple turns for more coherent reports.
deep-research-agent/
├── main.py # CLI entry point
├── .env.example # Environment template
├── pyproject.toml # Dependencies
└── src/
├── agents/
│ ├── supervisor.py # Minimax M2.1 supervisor
│ ├── planning_agent.py # Query planning
│ └── web_search_retriever.py # Exa search integration
├── tools/
│ └── exa_tool.py # Exa API wrapper
└── utils/
└── config.py # Configuration
| Service | URL | Purpose |
|---|---|---|
| Minimax M2.1 | platform.minimax.io | Supervisor reasoning |
| OpenRouter | openrouter.ai | Planning agent (Gemini) |
| Exa | exa.ai | Neural web search |
uv run python main.py -q "What are the latest breakthroughs in artificial general intelligence?"uv run python main.py -q "What are the emerging trends in electric vehicle adoption?" --saveuv run python main.py -q "What are the most promising approaches to carbon capture technology?" --verboseEdit system prompt in src/agents/supervisor.py
Edit src/agents/web_search_retriever.py:
num_results: Results per query (default: 5-10)time_period: Date filteringcontent_type: Filter by type (news, research, blog)
| Issue | Solution |
|---|---|
| Missing API keys | Ensure .env exists and has all keys set |
| API errors | Verify keys are valid, check rate limits |
| Import errors | Run uv sync and use uv run python main.py |
- Average query time: 30-60 seconds
- Factors: number of subqueries (3-5), search complexity, LLM response times
MIT License
Built with:
- Minimax M2.1 - Advanced reasoning model
- Exa - Neural web search
- Anthropic SDK - API client
- OpenRouter - LLM routing