Skip to main content
Swarm Type: MajorityVoting

Overview

The MajorityVoting swarm type has multiple agents independently analyze a problem and give their answer, then a consensus agent reads every answer and writes the final one. Votes are not counted: the consensus agent, a built-in Consensus-Agent on gpt-5.4, weighs the answers and writes a synthesized recommendation. This makes the architecture a fit when you want several independent opinions combined into one decision. Key features:
  • Independent Analysis: Each agent answers without seeing the others’ answers in the same loop
  • Consensus Agent: A built-in Consensus-Agent evaluates every answer and writes the final recommendation
  • Multi-loop: With max_loops above 1, the agents answer again with the previous round in context, followed by a new consensus
  • Transparent Process: Every agent’s answer and the consensus appear in output

Architecture

Each agent decides independently, without seeing the others. The Consensus-Agent then reads all of their answers and writes the final outcome; it does not tally votes.

Use Cases

  • Content quality assessment and approval
  • Problem diagnosis with multiple expert opinions
  • Decision-making in uncertain scenarios
  • Quality control and validation processes

API Usage

Basic MajorityVoting Example

Example Response:

Best Practices

  • Votes are not tallied, so there are no ties to avoid; the Consensus-Agent decides from the reasoning in each answer
  • Design agents with distinct evaluation criteria
  • Ensure clear voting instructions in system prompts
  • Ideal for quality control and approval workflows