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.
Overview
Swarms provides a comprehensive suite of orchestration methods for coordinating multiple AI agents in structured conversations and decision-making processes. These methods enable sophisticated multi-agent interactions like debates, panel discussions, negotiations, and more.
Installation
Available Methods
| Method | Description | Use Case |
|---|
| OneOnOneDebate | Turn-based debates between two agents | Philosophical discussions, arguments |
| ExpertPanelDiscussion | Expert panel discussions with a moderator | Professional discussions, expert opinions |
| RoundTableDiscussion | Round table discussions with multiple participants | Group discussions, brainstorming |
| InterviewSeries | Structured interviews with follow-up questions | Q&A sessions, information gathering |
| PeerReviewProcess | Academic peer review processes | Research review, feedback processes |
| MediationSession | Mediation sessions for conflict resolution | Dispute resolution, negotiations |
| BrainstormingSession | Brainstorming sessions for idea generation | Innovation, problem solving |
| TrialSimulation | Trial simulations with legal roles | Legal proceedings, case analysis |
| CouncilMeeting | Council meetings with voting procedures | Governance, voting processes |
| MentorshipSession | Mentorship sessions with feedback loops | Learning, guidance |
| NegotiationSession | Complex negotiations between parties | Business deals, agreements |
OneOnOneDebate
Simulates a turn-based debate between two agents for a specified number of loops. Each agent takes turns responding to the other’s arguments.
Attributes
Number of conversational turns
output_type
str
default:"str-all-except-first"
Format for conversation history
run()
Executes the debate between agents.
def run(self, task: str) -> list
Parameters:
task (str): The debate topic
Returns: list of conversation history
Example
Full example: Philosophy Discussion Example
from swarms import Agent
from swarms.structs.multi_agent_debates import OneOnOneDebate
# Create debating agents
agent1 = Agent(agent_name="Philosopher1", model_name="openai/gpt-4o")
agent2 = Agent(agent_name="Philosopher2", model_name="openai/gpt-4o")
# Initialize debate
debate = OneOnOneDebate(
max_loops=3,
agents=[agent1, agent2]
)
# Run debate
result = debate.run("Is artificial intelligence consciousness possible?")
ExpertPanelDiscussion
Simulates an expert panel discussion with a moderator guiding the conversation. Multiple experts provide insights on a topic with structured rounds.
Attributes
Number of discussion rounds
Expert panel participants
output_type
str
default:"str-all-except-first"
Format for conversation history
run()
Executes the panel discussion.
def run(self, task: str) -> list
Parameters:
task (str): The discussion topic
Returns: list of conversation history
Example
Full example: Healthcare Panel Discussion
from swarms import Agent
from swarms.structs.multi_agent_debates import ExpertPanelDiscussion
# Create expert agents
moderator = Agent(agent_name="Moderator", model_name="openai/gpt-4o")
expert1 = Agent(agent_name="AI_Expert", model_name="openai/gpt-4o")
expert2 = Agent(agent_name="Ethics_Expert", model_name="openai/gpt-4o")
expert3 = Agent(agent_name="Neuroscience_Expert", model_name="openai/gpt-4o")
# Initialize panel
panel = ExpertPanelDiscussion(
max_rounds=2,
agents=[expert1, expert2, expert3],
moderator=moderator
)
# Run panel discussion
result = panel.run("What are the ethical implications of AGI development?")
RoundTableDiscussion
Simulates a round table where each participant speaks in order, then the cycle repeats. Facilitated discussion with equal participation.
Attributes
Number of speaking cycles
output_type
str
default:"str-all-except-first"
Format for conversation history
run()
Executes the round table discussion.
def run(self, task: str) -> list
Parameters:
task (str): The discussion topic
Returns: list of conversation history
Example
Full example: AI Ethics Debate
from swarms import Agent
from swarms.structs.multi_agent_debates import RoundTableDiscussion
# Create participants
facilitator = Agent(agent_name="Facilitator", model_name="openai/gpt-4o")
participant1 = Agent(agent_name="Participant1", model_name="openai/gpt-4o")
participant2 = Agent(agent_name="Participant2", model_name="openai/gpt-4o")
participant3 = Agent(agent_name="Participant3", model_name="openai/gpt-4o")
# Initialize round table
roundtable = RoundTableDiscussion(
max_cycles=2,
agents=[participant1, participant2, participant3],
facilitator=facilitator
)
# Run discussion
result = roundtable.run("How can we improve renewable energy adoption?")
InterviewSeries
Conducts a structured interview with follow-up questions. Systematic Q&A with depth through follow-up questions.
Attributes
questions
List[str]
default:"Default questions"
Prepared interview questions
Follow-up questions per main question
output_type
str
default:"str-all-except-first"
Format for conversation history
run()
Executes the interview series.
def run(self, task: str) -> list
Parameters:
task (str): The interview topic
Returns: list of conversation history
Example
from swarms import Agent
from swarms.structs.multi_agent_debates import InterviewSeries
# Create agents
interviewer = Agent(agent_name="Interviewer", model_name="openai/gpt-4o")
interviewee = Agent(agent_name="Expert", model_name="openai/gpt-4o")
# Prepare questions
questions = [
"What is your background in AI?",
"How do you see AI evolving in the next decade?",
"What are the biggest challenges in AI development?"
]
# Initialize interview
interview = InterviewSeries(
questions=questions,
interviewer=interviewer,
interviewee=interviewee,
follow_up_depth=2
)
# Run interview
result = interview.run("AI Development and Future Prospects")
PeerReviewProcess
Simulates academic peer review with multiple reviewers and author responses. Structured feedback and revision process.
Attributes
output_type
str
default:"str-all-except-first"
Format for conversation history
run()
Executes the peer review process.
def run(self, task: str) -> list
Parameters:
task (str): The paper or topic to review
Returns: list of conversation history
Example
from swarms import Agent
from swarms.structs.multi_agent_debates import PeerReviewProcess
# Create agents
author = Agent(agent_name="Author", model_name="openai/gpt-4o")
reviewer1 = Agent(agent_name="Reviewer1", model_name="openai/gpt-4o")
reviewer2 = Agent(agent_name="Reviewer2", model_name="openai/gpt-4o")
# Initialize peer review
review = PeerReviewProcess(
reviewers=[reviewer1, reviewer2],
author=author,
review_rounds=2
)
# Run review process
result = review.run("New Machine Learning Algorithm for Natural Language Processing")
Simulates a mediation session to resolve conflicts between parties. Facilitated conflict resolution with structured sessions.
Attributes
Number of mediation sessions
output_type
str
default:"str-all-except-first"
Format for conversation history
run()
Executes the mediation session.
def run(self, task: str) -> list
Parameters:
task (str): The conflict to resolve
Returns: list of conversation history
Example
Full example: Merger Mediation Session
from swarms import Agent
from swarms.structs.multi_agent_debates import MediationSession
# Create agents
mediator = Agent(agent_name="Mediator", model_name="openai/gpt-4o")
party1 = Agent(agent_name="Party1", model_name="openai/gpt-4o")
party2 = Agent(agent_name="Party2", model_name="openai/gpt-4o")
# Initialize mediation
mediation = MediationSession(
parties=[party1, party2],
mediator=mediator,
max_sessions=3
)
# Run mediation
result = mediation.run("Resolve intellectual property dispute")
BrainstormingSession
Simulates a brainstorming session where participants build on each other’s ideas. Creative idea generation with collaborative building.
Attributes
Brainstorming participants
Number of idea generation rounds
Whether to build on previous ideas
output_type
str
default:"str-all-except-first"
Format for conversation history
run()
Executes the brainstorming session.
def run(self, task: str) -> list
Parameters:
task (str): The brainstorming topic
Returns: list of conversation history
Example
Full example: Pharma Research Brainstorm
from swarms import Agent
from swarms.structs.multi_agent_debates import BrainstormingSession
# Create agents
facilitator = Agent(agent_name="Facilitator", model_name="openai/gpt-4o")
participant1 = Agent(agent_name="Creative1", model_name="openai/gpt-4o")
participant2 = Agent(agent_name="Creative2", model_name="openai/gpt-4o")
participant3 = Agent(agent_name="Creative3", model_name="openai/gpt-4o")
# Initialize brainstorming
brainstorm = BrainstormingSession(
participants=[participant1, participant2, participant3],
facilitator=facilitator,
idea_rounds=3,
build_on_ideas=True
)
# Run brainstorming
result = brainstorm.run("Innovative solutions for urban transportation")
TrialSimulation
Simulates a legal trial with structured phases and roles. Complete legal proceeding simulation with all participants.
Attributes
witnesses
List[Agent]
default:"None"
Trial witnesses
phases
List[str]
default:"Default phases"
Trial phases
output_type
str
default:"str-all-except-first"
Format for conversation history
run()
Executes the trial simulation.
def run(self, task: str) -> list
Parameters:
task (str): The trial case
Returns: list of conversation history
Example
Full example: Medical Malpractice Trial
from swarms import Agent
from swarms.structs.multi_agent_debates import TrialSimulation
# Create agents
judge = Agent(agent_name="Judge", model_name="openai/gpt-4o")
prosecutor = Agent(agent_name="Prosecutor", model_name="openai/gpt-4o")
defense = Agent(agent_name="Defense", model_name="openai/gpt-4o")
witness1 = Agent(agent_name="Witness1", model_name="openai/gpt-4o")
witness2 = Agent(agent_name="Witness2", model_name="openai/gpt-4o")
# Initialize trial
trial = TrialSimulation(
prosecution=prosecutor,
defense=defense,
judge=judge,
witnesses=[witness1, witness2],
phases=["opening", "testimony", "cross", "closing"]
)
# Run trial
result = trial.run("Patent infringement case")
CouncilMeeting
Simulates a council meeting with structured discussion and decision-making. Governance process with voting and consensus building.
Attributes
Whether consensus is required
output_type
str
default:"str-all-except-first"
Format for conversation history
run()
Executes the council meeting.
def run(self, task: str) -> list
Parameters:
task (str): The meeting topic or proposal
Returns: list of conversation history
Example
Full example: Investment Council Meeting
from swarms import Agent
from swarms.structs.multi_agent_debates import CouncilMeeting
# Create agents
chairperson = Agent(agent_name="Chair", model_name="openai/gpt-4o")
member1 = Agent(agent_name="Member1", model_name="openai/gpt-4o")
member2 = Agent(agent_name="Member2", model_name="openai/gpt-4o")
member3 = Agent(agent_name="Member3", model_name="openai/gpt-4o")
# Initialize council meeting
council = CouncilMeeting(
council_members=[member1, member2, member3],
chairperson=chairperson,
voting_rounds=2,
require_consensus=True
)
# Run meeting
result = council.run("Vote on new environmental policy")
MentorshipSession
Simulates a mentorship session with structured learning and feedback. Guided learning process with progress tracking.
Attributes
Whether to include feedback
output_type
str
default:"str-all-except-first"
Format for conversation history
run()
Executes the mentorship session.
def run(self, task: str) -> list
Parameters:
task (str): The mentorship topic
Returns: list of conversation history
Example
Full example: Startup Mentorship Program
from swarms import Agent
from swarms.structs.multi_agent_debates import MentorshipSession
# Create agents
mentor = Agent(agent_name="Mentor", model_name="openai/gpt-4o")
mentee = Agent(agent_name="Mentee", model_name="openai/gpt-4o")
# Initialize mentorship
mentorship = MentorshipSession(
mentor=mentor,
mentee=mentee,
session_count=3,
include_feedback=True
)
# Run session
result = mentorship.run("Career development in AI research")
NegotiationSession
Simulates a negotiation with multiple parties working toward agreement. Complex multi-party negotiation with concessions.
Attributes
Whether to allow concessions
output_type
str
default:"str-all-except-first"
Format for conversation history
run()
Executes the negotiation session.
def run(self, task: str) -> list
Parameters:
task (str): The negotiation topic
Returns: list of conversation history
Example
Full example: NVIDIA-AMD Executive Negotiation
from swarms import Agent
from swarms.structs.multi_agent_debates import NegotiationSession
# Create agents
mediator = Agent(agent_name="Mediator", model_name="openai/gpt-4o")
party1 = Agent(agent_name="Company1", model_name="openai/gpt-4o")
party2 = Agent(agent_name="Company2", model_name="openai/gpt-4o")
# Initialize negotiation
negotiation = NegotiationSession(
parties=[party1, party2],
mediator=mediator,
negotiation_rounds=4,
include_concessions=True
)
# Run negotiation
result = negotiation.run("Merger terms negotiation")
Key Benefits
- Structured Communication: Each method provides a clear framework for organizing multi-agent interactions
- Role-Based Interactions: Agents can take on specific roles with defined responsibilities
- Flexible Configuration: Customizable parameters for controlling interaction flow
- Scalable Architecture: Support for various numbers of participants and interaction rounds
- Comprehensive Coverage: Methods for different use cases from debates to negotiations
- Professional Output: Consistent formatting and organization of conversation history
- Easy Integration: Simple API for incorporating into larger applications
Source Code
View the source code on GitHub