New Tool Radar

AI Agents & Automation

How to Set an AG2 Group Chat to Pick Speakers in Round-Robin Order

Set an AG2 group chat speaker selection method to round_robin so each agent speaks in turn instead of the manager choosing every time.

Schematic diagram with three steps: List the agents in order, Set round_robin, then Read the speaking order.

The GroupChatManager can select the next speaker in four ways: round_robin, random, manual and auto, which is the default and uses the manager language model. Round-robin is the predictable one: the manager selects agents in the order you listed them, which makes the conversation easy to trace.

Before you start

You need a working AG2 group chat with at least three agents. Write the speaking order you want before you change the setting, because the order is the order of the agents list.

Set the speaker selection method to round_robin

Pass the speaker selection method as round_robin when you create the GroupChat, or set it on the existing group chat. Keep the agents list in the order you want them to speak: first listed speaks first, then the next, and so on around the circle.

Run one chat and check the order matches the list

Start the group chat with a request that needs all three agents and read the speaker order in the log. Each agent should speak once per round, in list order. If one agent speaks twice in a row, the method did not apply and the manager is still choosing with auto.

Worked example: Speaking order for a fictional arithmetic group

The AG2 documentation illustrates a group chat with arithmetic agents turning a number into a target. The table shows one round in round-robin order.

Turn Speaker Job
1 Adder agent Adds to the number
2 Multiplier agent Multiplies the number
3 Subtracter agent Subtracts from the number
4 Divider agent Divides the number

Expected result (UNTESTED): the log shows the four agents speaking in list order, one turn each, with no repeats inside a round. We checked the AG2 GroupChat documentation, which lists round_robin among the four selection strategies, but we did not run the chat on this machine.

Limits

Round-robin is fair but not smart: it gives every agent a turn even when only one agent has something useful to say. Use it when the order matters more than the choice, and use auto when the next speaker genuinely depends on the conversation.

Sources

See all