A production-grade agentic research system that orchestrates parallel AI agents to conduct comprehensive research with intelligent content compression and iterative verification.
This system spawns multiple specialized AI agents that work in parallel to research topics comprehensively, automatically compress findings to stay within context limits, and iteratively refine results until confidence thresholds are met.
Key Stats:
- 25 searches per iteration (5 agents Γ 5 searches each)
- 90-95% compression ratio (10KB+ β 500 tokens)
- ~$0.07-0.10 per complete research session
- 30-75 seconds typical completion time
- Orchestrator Agent - Coordinates research strategy
- Search Agents (5 parallel) - Execute searches via MCP Omnisearch
- Compression Agent - Automatic 90%+ content reduction
- Verification Agent - Quality control with confidence scoring
- Context Editor - Optimizes context window management
- Synthesis Agent - Generates comprehensive reports
- Claude (Anthropic): Sonnet 4 + Haiku 3.5
- OpenAI: GPT-5 + GPT-5-mini
- OpenRouter: Kimi-K2 + Qwen3-30B
- Gemini: 2.5 Pro + 2.5 Flash
- Iterative Research Loop - Continues until confidence threshold met
- Hook System - Automatic compression, validation, optimization
- MCP Integration - Omnisearch (7 providers) + Sequential Thinking
- Cost Tracking - Real-time monitoring with budget alerts
- Rate Limiting - Token bucket algorithm prevents API overload
# Clone repository
git clone <repo-url>
cd AgenticResearcher
# Create virtual environment with UV
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install Python dependencies
uv pip install -r requirements.txt
# Install MCP servers (required for search functionality)
# Sequential Thinking MCP Server
npx -y @modelcontextprotocol/server-sequential-thinking
# MCP Omnisearch (for multi-provider search)
# Note: Replace with actual installation path or use global install
npm install -g mcp-omnisearch
# OR install locally in project directory:
# npm install mcp-omnisearch- Copy secrets template:
cp config/secrets.template.json config/secrets.json- Add your API keys to
config/secrets.json:
{
"providers": {
"claude": {
"api_key": "sk-ant-api03-...",
"enabled": true
}
},
"mcp_tools": {
"tavily_api_key": "tvly-...",
"brave_api_key": "BSA...",
"exa_api_key": "",
"kagi_api_key": "",
"github_token": ""
}
}- Configure MCP servers (optional - edit
config/mcp_servers.json)
# Run a research query
uv run main.py "What are the latest developments in quantum computing?"
# With custom options
uv run main.py "AI safety challenges" --provider claude --max-iterations 5 --output report.md
# Verbose mode for debugging
uv run main.py "Quantum computing" --verbose
# Or with Python directly (if venv activated)
source .venv/bin/activate
python main.py "Your research query here"User Query
β
Sequential Thinking (Research Planning)
β
Orchestrator (Generate 5 Research Angles)
β
Spawn 5 Search Agents (Parallel)
β (each executes 5 searches)
25 Searches β Compression Hooks (90% reduction)
β
Verification Agent (Quality Check)
β
Decision: Continue or Complete?
β (if confidence < threshold)
Spawn More Agents (next iteration)
β (if confidence β₯ threshold)
Context Editor (Optimize)
β
Synthesis Agent (Generate Report)
β
Final Markdown Report
- orchestrator.py - Workflow coordination
- search_agent.py - Parallel search execution
- compression_agent.py - Content compression
- verification_agent.py - Quality control (5 metrics)
- context_editor.py - Context optimization
- synthesis_agent.py - Report generation
- base.py - Abstract provider interface
- claude_provider.py - Anthropic implementation
- Additional providers: OpenAI, OpenRouter, Gemini (planned)
- compression_hooks.py - POST_SEARCH compression
- validation_hooks.py - PRE_TOOL validation
- context_hooks.py - PRE_MESSAGE optimization
- research_loop.py - Main iterative loop
- cost_tracker.py - Budget monitoring
- rate_limiter.py - API rate management
- metrics.py - Performance tracking
- omnisearch.py - 8 search providers (Tavily, Brave, Exa, Kagi, Perplexity, Jina, Firecrawl, GitHub)
- sequential_thinking.py - Strategic reasoning and planning
- Coverage Score - Aspect completeness (0.0-1.0)
- Depth Score - Information detail (0.0-1.0)
- Source Quality - Authority & recency (0.0-1.0)
- Consistency Score - Finding agreement (0.0-1.0)
- Overall Confidence - Weighted combination
- Total Searches: 75 (3 Γ 25)
- Compression: 88-92% reduction
- Cost: $0.07-0.10
- Duration: 45-75 seconds
- Final Confidence: 0.85-0.95
results = await research_loop(
query="Advanced quantum algorithms for cryptography",
provider_name="claude",
max_iterations=5,
confidence_threshold=0.90,
min_searches=25,
compression_ratio=0.95, # 95% compression
max_cost=0.50 # Budget limit
)# Use OpenAI instead of Claude
results = await research_loop(
query="Climate change mitigation strategies",
provider_name="openai", # Switch provider
max_iterations=3
)from hooks import register_hook
@register_hook("post_search", priority=300)
async def custom_compression(result):
# Custom compression logic
return compressed_result- ARCHITECTURE_DIAGRAMS.md - Visual system architecture
- IMPLEMENTATION_REPORT.md - Technical implementation details
- INTEGRATION_GUIDE.md - Integration patterns and examples
- HOOKS_IMPLEMENTATION_REPORT.md - Hook system details
- FILES_INDEX.md - Complete file reference
# Run verification script
python verify_implementation.py
# Test hook system
python example_hook_usage.pyAgenticResearcher/
βββ agents/ # Specialized agent implementations
βββ providers/ # LLM provider abstractions
βββ hooks/ # Hook system for optimization
βββ mcp/ # MCP server integrations
βββ core/ # Research loop and utilities
βββ utils/ # Configuration and logging
βββ config/ # Configuration files
- Create
providers/your_provider.py - Inherit from
BaseProvider - Implement required methods
- Add to
config/providers.json - Configure API key in
config/secrets.json
See providers/claude_provider.py for reference implementation.
Contributions welcome! Areas for improvement:
- Additional LLM providers
- More search provider integrations
- Enhanced compression algorithms
- Performance optimizations
- Test coverage
MIT License - See LICENSE file for details
Built with:
- Claude Agent SDK - Agent orchestration
- MCP Omnisearch - Unified search interface
- Sequential Thinking MCP - Strategic reasoning
- Anthropic Claude - LLM capabilities
For issues, questions, or contributions, please open an issue on GitHub.
Status: Production-ready MVP with core functionality complete Version: 1.0.0 Last Updated: October 2025