ExpertPanelDiscussion runs a panel like one on a conference stage. A moderator agent opens each round with a question. Every expert answers it in turn. The moderator then sums up the answers and asks a follow-up question, which becomes the topic of the next round. You get back the full transcript.
Use it when you want several specialist views on one topic, steered by a moderator who keeps the discussion moving.
ExpertPanelDiscussion is not exported from the top-level swarms package. Import it from swarms.structs.multi_agent_debates.
Reference: ExpertPanelDiscussion.
1. Run a panel
Pass at least two experts asagents and one moderator. max_rounds sets the number of rounds; the default is 3. Here one round keeps the run short, and output_type="list" returns each message with its speaker.
run raises ValueError if agents has fewer than two experts or moderator is not set. The check happens when you call run, not when you build the panel.
2. How a round works
Before the first round, the panel briefs every agent. The moderator is told who is on the panel. Each expert is told its number, the other experts’ names and the moderator’s name. These briefing replies are not part of the transcript. Then, in each round:- The moderator gets
Round N: <topic>and opens the round. The first round’s topic is your task. - Each expert, in list order, gets
Expert <name>, please respond to: <moderator's message>. Experts do not see each other’s answers from the same round. - The moderator gets every expert’s answer for the round, as one
name: answerblock per expert, and is asked to sum up and ask a follow-up question. - That summary becomes the next round’s topic.
1 + N + max_rounds * (N + 2) agent calls for N experts, one after another. The panel in section 1 makes 9.
3. Read the transcript
The transcript does not include your task. Its first message is the moderator’s opening of round 1. That matters foroutput_type:
For a readable record, use
"str" or "list". Here two rounds run between an economist and a founder:
4. Run the same panel again
The panel does not reset its agents. Each agent keeps the earlier panel in its memory, so a second topic would be discussed with the first one still in context. Callreset() on every agent first, or build new agents. This continues from section 1:
output_type="final", run returns only the moderator’s closing summary and question, which is a quick way to see where the panel ended up.
Tips
- Keep answers short. Each round’s summary prompt carries every expert’s answer, and every agent keeps its full history. A word limit in each system prompt keeps later rounds fast.
- Give experts distinct roles. Experts who share a prompt give the moderator little to sum up.
- Track cost with
panel.usage, which sums the token counts of the moderator and every expert.
Next steps
- ExpertPanelDiscussion reference
- OneOnOneDebate guide, for two agents and no moderator
- Group chat guide, where agents bid for the next turn
- Runnable scripts