> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swarms.world/llms.txt
> Use this file to discover all available pages before exploring further.

# OneOnOneDebate Guide

> Let two agents argue in turns, each replying to the other's last answer, and read back the transcript

`OneOnOneDebate` puts two agents in a back-and-forth. The first agent answers your task. The second agent replies to that answer. Then the first replies to the second, and so on, one turn at a time. There is no judge and no moderator: you get the transcript and decide what to do with it.

The same debate is also available as a plain function, `one_on_one_debate`. The class calls that function, so both behave the same way.

Neither is exported from the top-level `swarms` package. Import the class from `swarms.structs.multi_agent_debates` and the function from `swarms.structs.deep_discussion`.

Reference: [OneOnOneDebate and one\_on\_one\_debate](https://docs.swarms.world/api/orchestration-methods.md#oneononedebate).

## 1. Run a debate

Pass exactly two agents. `max_loops` is the total number of turns, so `max_loops=4` gives each agent two turns. `output_type="list"` returns each turn with its speaker.

```python theme={null}
from swarms import Agent
from swarms.structs.multi_agent_debates import OneOnOneDebate

RULES = "Reply in one paragraph of under 80 words, as yourself only, with no name prefix."

pro = Agent(
    agent_name="Pro",
    system_prompt=f"You argue for the motion. {RULES}",
    model_name="gpt-5.4-mini",
    max_loops=1,
)
con = Agent(
    agent_name="Con",
    system_prompt=f"You argue against the motion. {RULES}",
    model_name="gpt-5.4-mini",
    max_loops=1,
)

debate = OneOnOneDebate(
    max_loops=4,
    agents=[pro, con],
    output_type="list",
)

turns = debate.run("Motion: remote work is better for junior engineers.")

for turn in turns:
    print(f"--- {turn['role']}")
    print(turn["content"])
```

`run` raises `ValueError` if `agents` does not hold exactly two agents. The check happens when you call `run`, not when you build the debate.

> [!TIP]
>
> Tell each agent to reply only as itself. Without that, models sometimes start with their own name or write the other side's lines into their answer.

## 2. How the turns work

* **One call per turn.** A run makes `max_loops` agent calls. `agents[0]` speaks on turns 1, 3, 5 and so on, and `agents[1]` on turns 2, 4, 6. With `max_loops=1`, only the first agent speaks.
* **Introductions are folded in.** Each agent's first turn starts with `You are <name> debating against <other name>. Your role is to engage in a thoughtful debate.`, followed by the message it is replying to. There are no separate introduction calls.
* **Only answers are passed on.** Each turn records the speaker's final answer and sends only that answer to the other agent, never the speaker's whole conversation.
* **Fresh agents every run.** Both agents are reset at the start of every run, so a second debate never carries the first one's turns.
* **Images.** The class's `img` parameter, or the function's, is sent with every turn. Use a model that accepts images.

## 3. Read the transcript

The transcript does not include your task. Its first message is the first agent's opening turn. That matters for `output_type`:

| `output_type` | Returns |
| - | - |
| `"str-all-except-first"` (default) | Every turn's text except the first, so the opening turn is dropped, with no speaker names |
| `"str"` | Every turn as `Name: text`, separated by blank lines |
| `"list"` | A list of `{"role", "content"}` dicts, one per turn |
| `"final"` | The last turn's text |

For a readable record, use `"str"` or `"list"`.

## 4. Use the function form

`one_on_one_debate` takes the same settings as arguments and returns the formatted transcript. Use it when you don't need an object to keep. Here three turns give the optimist the first and last word:

```python theme={null}
from swarms import Agent
from swarms.structs.deep_discussion import one_on_one_debate

RULES = "Reply in one paragraph of under 60 words, as yourself only, with no name prefix."

optimist = Agent(
    agent_name="Optimist",
    system_prompt=f"You expect fast progress. {RULES}",
    model_name="gpt-5.4-mini",
    max_loops=1,
)
skeptic = Agent(
    agent_name="Skeptic",
    system_prompt=f"You expect slow progress. {RULES}",
    model_name="gpt-5.4-mini",
    max_loops=1,
)

transcript = one_on_one_debate(
    max_loops=3,
    task="Will most new code be written by AI agents by 2028?",
    agents=[optimist, skeptic],
    output_type="str",
)
print(transcript)
```

## 5. Reuse a debate and track tokens

Because both agents are reset at the start of every run, one `OneOnOneDebate` can take many motions in a row. `output_type="final"` returns the last turn, here the second agent's closing reply. `usage` sums the token counts of both agents across every run. This continues from section 1:

```python theme={null}
debate = OneOnOneDebate(max_loops=2, agents=[pro, con], output_type="final")

for motion in [
    "Motion: code review slows teams down.",
    "Motion: every service needs an on-call rotation.",
]:
    # Both agents start fresh, so the first motion does not leak into the second
    closing = debate.run(motion)
    print(f"{motion}\nLast word: {closing}\n")

print(debate.usage)
```

The reset clears each agent's conversation, not its `usage`, so the total keeps growing across runs.

## Tips

* **Pick the turn count for who speaks last.** An even `max_loops` gives the last word to `agents[1]`, an odd one to `agents[0]`.
* **Add a judge yourself.** The debate returns a transcript only. Pass the `"str"` output to a third agent to pick a winner, or use [DebateWithJudge](https://docs.swarms.world/examples/multi-agent/debate-quickstart.md), which has a judge built in.
* **Run debates one at a time per pair.** Both agents are reset at the start of each run, so two debates running on the same agents at once would clear each other's turns.

## Next steps

* [OneOnOneDebate reference](https://docs.swarms.world/api/orchestration-methods.md#oneononedebate)
* [ExpertPanelDiscussion guide](https://docs.swarms.world/examples/multi-agent/expert-panel-discussion-example.md), for a moderated panel of several experts
* [DebateWithJudge quickstart](https://docs.swarms.world/examples/multi-agent/debate-quickstart.md)
* [Runnable scripts](https://github.com/kyegomez/swarms/tree/master/examples/multi_agent/orchestration_examples)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.