Skip to content

mdc159/multi-model-research

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Model Research (MMR)

Orchestrate deep research across multiple AI models to produce comprehensive, professional-grade research documents.

Goal

Produce research output comparable to or exceeding OpenAI's o3 Deep Research - comprehensive, insightful, PhD-level analysis with no information loss.

Architecture

Optimized for Claude Code Max plan - Claude Code (your session) acts as the orchestrator for FREE.

┌─────────────────────────────────────────────────────────────────────────┐
│                         Claude Code (FREE)                               │
│                         Your session = Orchestrator                      │
│                                                                          │
│   1. Plan research angles                                                │
│   2. Dispatch parallel researchers                                       │
│   3. Validate via subagents (FREE)                                       │
│   4. Aggregate via Gemini 1M                                             │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                    ┌───────────────┼───────────────┐
                    ▼               ▼               ▼
          ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
          │ Researcher 1│ │ Researcher 2│ │ Researcher 3│  PARALLEL
          │ (Perplexity)│ │ (Perplexity)│ │ (Perplexity)│
          │ Sonar Pro   │ │ Sonar Pro   │ │ Sonar Pro   │  Built-in
          └──────┬──────┘ └──────┬──────┘ └──────┬──────┘  web search
                 │               │               │
                 └───────────────┼───────────────┘
                                 ▼
          ┌─────────────────────────────────────────────┐
          │           Claude Code Subagents             │  PARALLEL
          │           (FREE validation)                 │
          └─────────────────────────────────────────────┘
                                 │
                                 ▼
          ┌─────────────────────────────────────────────┐
          │             Gemini Pro 3                    │
          │             1M context aggregation          │
          └─────────────────────────────────────────────┘

Cost Analysis

Component Provider Cost per Run
Orchestration Claude Code $0 (Max plan)
Research (6 angles) Perplexity Sonar Pro ~$0.30
Validation (6 angles) Claude Code subagents $0 (Max plan)
Aggregation Gemini Pro 3 ~$0.05
Total ~$0.35

Compare to full API orchestration: ~$5+

Installation

cd ~/Documents/repos/multi-model-research
uv sync

Configuration

Set API keys:

export PERPLEXITY_API_KEY="pplx-..."
export GOOGLE_API_KEY="..."  # For Gemini aggregation

Usage from Claude Code

The recommended way to use MMR is directly from Claude Code, which acts as your orchestrator:

from multi_model_research.library import (
    research_angles_parallel,
    aggregate_research,
    save_raw_research,
)

# Define research angles
angles = [
    {"id": "legal", "title": "Legal Framework", "questions": ["What laws govern X?"]},
    {"id": "market", "title": "Market Analysis", "questions": ["What are current trends?"]},
    # ... more angles
]

# Run parallel research (Perplexity Sonar Pro with web search)
results = research_angles_parallel(angles, instructions="Focus on 2024-2026 data")

# Save raw research for reference
save_raw_research(results, "/path/to/raw.json")

# Aggregate into final report (Gemini 1M)
report = aggregate_research(
    topic="Your Research Topic",
    research_outputs=results,
    output_path="/path/to/final-report.md"
)

CLI Usage

# Basic research
mmr research "AI safety approaches" ./output/report.md

# With options
mmr research "Mexico real estate" ~/Documents/report.md \
    --agents 4 \
    --context "Focus on Baja California" \
    --preset perplexity-research

Presets

Preset Orchestrator Researchers Best For
perplexity-research Claude Code Perplexity Sonar Pro Current web data
opus-gemini Claude Opus Gemini Pro 3 Deep analysis
all-gemini Gemini Pro 3 Gemini Pro 3 1M context

Key Design Principles

  1. Claude Code as orchestrator - Leverage your Max plan, no API costs for planning
  2. Perplexity for research - Built-in web search with citations
  3. Parallel execution - Research all angles simultaneously
  4. Subagent validation - Free validation via Claude Code subagents
  5. No premature summarization - Research outputs are FULL content
  6. Aggregation not summarization - Final report preserves all details

Development Status

See DEVELOPMENT.md for detailed iteration history and current challenges.

What Works

  • Parallel research execution (~2 min for 6 angles)
  • Perplexity web search integration
  • Claude Code subagent validation
  • Raw research export (JSON)

Current Challenge

  • LLM aggregation tends to compress/summarize
  • Exploring mechanical compilation + LLM analysis as separate steps

Pydantic Schemas

  • ResearchRequest - Input configuration
  • ResearchAngle - A specific research area
  • ResearchOutput - Full research from one agent
  • ValidationResult - Pass/fail with issues
  • FinalReport - Aggregated output

License

MIT

About

Multi-model research orchestration framework for Claude Code Max - parallel research with Perplexity, validation with subagents, aggregation with Gemini 1M

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages