Skip to main content

Cross-session multi-agent debate MCP server. Same model, different context depths, better decisions.

Project description

Ploidy

Intentional context asymmetry to reduce confirmation bias in LLMs.

CI Docs License: MIT Python 3.11+

Why

Ask the same model the same question in separate sessions. You'll get different answers every time — some agree, some disagree, some equivocate. If you continue in just one session, the model's first stochastic response becomes an anchor. It reinforces its own prior, the user builds on it, and the session locks into a trajectory that prompt engineering cannot undo.

This means identical models, identical prompts, identical users — but different project outcomes depending on which random sample landed first. The user is in a probability lottery without knowing it. Task completion time varies, task success varies, and perceived "model performance" varies — all from the same model.

This is not the same problem that multi-agent teams solve. Agent teams (CrewAI, MetaGPT, Claude Agent Teams) divide labor across models for throughput. More hands, same perspective. Under symmetric information, scaling agents is mathematically equivalent to majority voting over identically biased samples — it cannot improve expected correctness.

Ploidy takes the orthogonal approach: deliberately create context asymmetry within the same model, then make the asymmetric sessions debate. A deep session carries full project context. A fresh session starts with zero prior commitment. When they disagree, the cause is isolatable — one has context the other doesn't. That disagreement is the signal.

Quick Start

# Install
pip install ploidy              # core server
pip install ploidy[api]         # + auto-debate mode (requires OpenAI SDK)

# Start the server
python -m ploidy

Terminal 1 (Deep session) — tell your AI:

"Start a Ploidy debate: Should we use monorepo or polyrepo?"

Terminal 2 (Fresh session) — tell your AI:

"Join Ploidy debate a1b2c3d4e5f6"

MCP Client Configuration

{
  "mcpServers": {
    "ploidy": {
      "type": "streamable-http",
      "url": "http://localhost:8765/mcp"
    }
  }
}

How It Works

Terminal 1 (Deep)              Terminal 2 (Fresh)
[Full project context]         [Zero context]
        |                              |
        └──── debate/start ──→ Ploidy Server ←── debate/join ────┘
                               (port 8765)
              position ──────→ [SQLite + WAL] ←────── position
              challenge ─────→ [State Machine] ←───── challenge
              converge ──────→ [Convergence]  ←────── converge
                                    ↓
                            Structured Result
                         (agreements, disagreements,
                          confidence score)

Sessions debate through typed semantic actions (agree, challenge, propose alternative, synthesize) across a five-phase protocol: Independent → Position → Challenge → Convergence → Complete. The Context Asymmetry Spectrum ranges from Deep (full context) through Semi-Fresh (compressed context, passively or actively delivered) to Fresh (zero context).

Tools

Tool Description
debate_start Begin a debate with a prompt
debate_join Join as a fresh (zero-context) session
debate_position Submit your stance
debate_challenge Critique with semantic actions (agree/challenge/propose_alternative/synthesize)
debate_converge Trigger convergence analysis
debate_status Check current state
debate_cancel Cancel in progress
debate_delete Permanently delete
debate_history List past debates
debate_auto Run a full two-sided debate automatically via API

Configuration

All via environment variables:

PLOIDY_PORT=8765              # Server port
PLOIDY_DB_PATH=~/.ploidy/ploidy.db  # Database location
PLOIDY_LOG_LEVEL=INFO         # Logging level
PLOIDY_AUTH_TOKEN=secret      # Bearer token auth (optional)
PLOIDY_API_BASE_URL=https://api.openai.com/v1  # Optional auto-debate backend
PLOIDY_API_KEY=...            # Optional API key for auto mode
PLOIDY_API_MODEL=gpt-5.4      # Optional model override for auto mode

Single-Terminal Auto Mode

If you configure an OpenAI-compatible API backend, Ploidy can run both sides of the debate automatically in one tool call. In debate_auto, the server generates:

  • an Experienced position using the provided context_documents
  • a Fresh or Semi-Fresh counter-position
  • challenge messages from both sides
  • the final convergence analysis

Fresh auto sessions must use delivery_mode="none". Semi-Fresh auto sessions must use delivery_mode="passive" or delivery_mode="active".

Docker

docker compose up

Documentation

Research

Ploidy extends Cross-Context Review (Song 2026) from unidirectional fresh-session review to bidirectional structured debate. The intersection of context asymmetry × same-model debate × structured protocol has zero published papers as of March 2026.

In pilot experiments, context asymmetry shows no benefit on short-context tasks where entrenchment does not occur — but on long-context tasks with anchoring bias, asymmetric debate achieves the highest ground-truth recall (5/5 vs. single session's 3/5). These results bound where the intervention applies.

License

MIT

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

ploidy-0.3.2.tar.gz (180.8 kB view details)

Uploaded Source

Built Distribution

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

ploidy-0.3.2-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file ploidy-0.3.2.tar.gz.

File metadata

  • Download URL: ploidy-0.3.2.tar.gz
  • Upload date:
  • Size: 180.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for ploidy-0.3.2.tar.gz
Algorithm Hash digest
SHA256 6c7e2cbda5db35f0bab6691e0f25c9184983130df66b5ebf712ea46c38099b03
MD5 b6b0117a698a2945e7753e6a8a79de83
BLAKE2b-256 055f09c6e35a5f54214bd2b2211381ee0c969d35fe0f4e2bbfe126fccf3d3176

See more details on using hashes here.

File details

Details for the file ploidy-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: ploidy-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for ploidy-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 639904a4689490f3318bc14d1b3e7c25ceb563ff29e877baae701e65545621c7
MD5 797bd1a195d49f8b956d6c30daaa020b
BLAKE2b-256 3042f02c8229c8c389a0c633ea144e7abbf9dc7123a30053ea54a23638a6cae7

See more details on using hashes here.

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