Skip to main content

AI-to-AI debate orchestration for better decision-making

Project description

AI Debate Tool

AI-to-AI debate orchestration for better decision-making.

CI PyPI version License: MIT Python 3.10+


What is this?

AI Debate Tool orchestrates debates between multiple AI perspectives (Claude + Codex) to help make better decisions on complex code changes, architectural decisions, and implementation plans.

Key Features:

  • Dual-AI debates - Get diverse perspectives from Claude and Codex
  • Consensus scoring - 0-100 score indicating agreement level
  • Fast execution - 10-18 seconds per debate
  • Pattern learning - Improves recommendations over time
  • Zero API costs - Uses Codex CLI (no ongoing fees)

Installation

pip install ai-debate-tool

Requirements

  • Python 3.10+
  • Codex CLI installed and authenticated

Quick Start

CLI Usage

# Run a debate on a plan file
ai-debate run "Review this refactoring plan" --file plans/refactor.md

# Check if a change needs debate (complexity scoring)
ai-debate check "Add caching layer" --files cache.py db.py

# View debate history
ai-debate history --limit 5

# Initialize configuration
ai-debate config --init

Python API

import asyncio
from ai_debate_tool import get_orchestrator

async def main():
    # Create orchestrator
    Orchestrator = get_orchestrator()
    orchestrator = Orchestrator(enable_cache=True, enable_intelligence=True)

    # Run a debate
    result = await orchestrator.run_debate(
        request="Review this refactoring plan",
        file_path="plans/refactor.md",
        focus_areas=["architecture", "testing"]
    )

    # Check results
    print(f"Consensus: {result['debate_result']['consensus_score']}/100")
    print(f"Recommendation: {result['debate_result']['recommendation']}")

asyncio.run(main())

Check If Debate Is Needed

from ai_debate_tool import check_debate_required

result = check_debate_required(
    request="Refactor authentication module",
    file_paths=["auth/views.py", "auth/models.py"]
)

if result["required"]:
    print(f"Debate recommended (complexity: {result['complexity_score']})")
else:
    print("Simple change, proceed without debate")

CLI Reference

ai-debate run

Run a debate on a topic/file.

ai-debate run <topic> --file <path> [options]

Options:
  -f, --file PATH      Path to file to debate (required)
  -F, --focus TEXT     Focus areas (can specify multiple)
  -t, --target INT     Target consensus score (default: 75)
  -o, --output PATH    Save results to JSON file
  -v, --verbose        Verbose output

Examples:

# Basic debate
ai-debate run "Review this API design" --file api_spec.md

# With focus areas
ai-debate run "Check security implications" --file auth.py -F security -F validation

# Save results
ai-debate run "Architecture review" --file design.md -o results.json -v

ai-debate check

Check if a change requires debate (complexity scoring).

ai-debate check <request> [options]

Options:
  -f, --files TEXT     Files to check (can specify multiple)
  -t, --threshold INT  Complexity threshold (default: 40)
  --json               Output as JSON

Examples:

ai-debate check "Add user authentication" --files auth.py models.py
ai-debate check "Fix typo in README" --threshold 20

ai-debate history

View debate history.

ai-debate history [options]

Options:
  -n, --limit INT  Number of entries (default: 10)
  --stats          Show statistics only
  --json           Output as JSON

ai-debate config

Manage configuration.

ai-debate config [options]

Options:
  --init   Initialize configuration file
  --show   Show current configuration
  --path   Show config file path

How It Works

1. INPUT
   └── Your request + file path + optional focus areas

2. PRE-DEBATE ANALYSIS
   ├── Pattern detection from history
   ├── Risk prediction
   └── Suggested focus areas

3. PARALLEL DEBATE
   ├── Claude perspective (via Codex CLI)
   └── Codex perspective (via Codex CLI)

4. CONSENSUS ANALYSIS
   └── Score agreement, identify disagreements

5. OUTPUT
   └── Consensus score + recommendations + insights

Consensus Scores

Score Interpretation Recommendation
90-100 Strong Agreement Proceed confidently
75-89 Good Agreement Proceed with minor review
60-74 Moderate Agreement Discuss key points first
40-59 Mixed Views Significant discussion needed
0-39 Strong Disagreement Major concerns to address

Configuration

Create a config file with ai-debate config --init:

{
  "enabled": true,
  "complexity_threshold": 40,
  "target_consensus": 75,
  "max_rounds": 5,
  "enable_cache": true,
  "enable_intelligence": true,
  "log_level": "INFO"
}

Or use environment variables:

  • ENABLE_AI_DEBATE - Enable/disable debates
  • DEBATE_COMPLEXITY_THRESHOLD - Minimum complexity for debate
  • DEBATE_TARGET_CONSENSUS - Target consensus score

Roadmap

  • v1.0.0 (Current): Core library + CLI
  • v1.1.0 (Planned): MCP server integration
  • v1.2.0 (Planned): VS Code extensions

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

# Clone the repo
git clone https://github.com/ai-debate-tool/ai-debate-tool.git
cd ai-debate-tool

# Install in development mode
pip install -e .[dev]

# Run tests
pytest --cov

# Format code
black src/

License

MIT License - see LICENSE for details.


Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_debate_tool-1.0.0.tar.gz (76.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_debate_tool-1.0.0-py3-none-any.whl (94.2 kB view details)

Uploaded Python 3

File details

Details for the file ai_debate_tool-1.0.0.tar.gz.

File metadata

  • Download URL: ai_debate_tool-1.0.0.tar.gz
  • Upload date:
  • Size: 76.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai_debate_tool-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ce73c2d60aaf5468f3f44d3fd359e6d165fe8a3bb45281d74f04e633dc6ed8cc
MD5 25f3eabb8c3d131374edea0aa2d59081
BLAKE2b-256 7f213fb600dc93f479887e506860a68a50fcb7921f59ee4e07e2865780468213

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_debate_tool-1.0.0.tar.gz:

Publisher: release.yml on Freakingnolife/ai-debate-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_debate_tool-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ai_debate_tool-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 94.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai_debate_tool-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af857a31732ed5248271dbe7533bf1205328b8a1ef39177aa0e4e2287995ab59
MD5 5242bc435c81aa10e3c2d32692f8d8df
BLAKE2b-256 5020ac7bb2fe66cde13fa488bece26c0fcf4fb5622c456f823db943926cae019

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_debate_tool-1.0.0-py3-none-any.whl:

Publisher: release.yml on Freakingnolife/ai-debate-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page