Skip to content

feat: add multi-agent debate orchestrator for consensus-based reasoning - #1072

Merged
AmitoVrito merged 2 commits into
SynapseKit:mainfrom
ramashishmaurya:feat/multi-agent-debate
Oct 13, 2026
Merged

AmitoVrito merged 2 commits into
SynapseKit:mainfrom
ramashishmaurya:feat/multi-agent-debate

Conversation

@ramashishmaurya

Copy link
Copy Markdown
Contributor

Description

This PR introduces the DebateOrchestrator to synapsekit.agents.multi, adding a powerful new multi-agent pattern to the framework.

While existing orchestrators (crew.py, supervisor.py) are excellent for sequential delegation, they lack a native mechanism to resolve disagreements or prevent hallucinations through consensus. The DebateOrchestrator solves this by forcing two agents (a Proposer and an Opponent) to argue a topic over multiple rounds, while a Judge synthesizes the transcript to produce a final, highly accurate decision.

Changes Included

  • Added src/synapsekit/agents/multi/debate.py containing Debater, Judge, and DebateOrchestrator.
  • Exported new classes in src/synapsekit/agents/multi/__init__.py.
  • Added comprehensive unit tests in tests/agents/test_multi_debate.py simulating a full 2-round debate with a mocked LLM.

Testing

  • Tested with pytest tests/agents/test_multi_debate.py (passes 100%).
  • Checked with pre-commit (ruff, trailing whitespaces, etc. are clean).

ramashishmaurya and others added 2 commits October 13, 2026 19:14
DebateOrchestrator runs a proposer and opponent through N rounds of
rebuttal/defense, then has a judge synthesize a final decision from
the transcript.

At merge, fixed a context-amnesia bug before it shipped: each
executor's ReActAgent clears its own scratchpad on every run() call,
so passing only the single latest message into each round's prompt
meant every participant forgot its own and the other side's earlier
arguments after round 1. Each prompt now re-injects the full
transcript so far. Added a regression test that fails on the old
code and passes on the fix.

Co-authored-by: Ashish Maurya <[email protected]>
@AmitoVrito
AmitoVrito force-pushed the feat/multi-agent-debate branch from 61d7b78 to 66550d2 Compare October 13, 2026 17:19

@AmitoVrito AmitoVrito left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and hardened before merge: stripped the leftover debug artifacts this PR was stacked with (fake_audit.jsonl, pr_body.md, scratch.py, scratch3.py) by rebasing just the debate-orchestrator commit onto main, and fixed a context-amnesia bug — each executor's ReActAgent clears its own scratchpad every run(), so only passing the single latest message into each round's prompt meant every participant forgot its own and the other side's earlier arguments after round 1. Each prompt now re-injects the full transcript, with a regression test confirmed to fail on the old code.

@AmitoVrito
AmitoVrito merged commit 56a7454 into SynapseKit:main Oct 13, 2026
19 checks passed
AmitoVrito added a commit that referenced this pull request Oct 13, 2026
ramashishmaurya added a commit to ramashishmaurya/SynapseKit that referenced this pull request Nov 7, 2026
Each opening/rebuttal/defense/judge prompt is now prefixed with
"You are {name}, acting as: {role}.", so a debater's persona reaches the model
on every turn (the executors' ReActAgent wipes its scratchpad between turns).
Complements the transcript re-injection already in SynapseKit#1072.

Co-authored-by: Ashish Maurya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants