Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
AutoGen routes every turn through a GroupChatManager whose select_speaker policy chooses the next agent; the UserProxyAgent doubles as the human stand-in and the tool executor.
Picture a small meeting with a chairperson, a question-asker, and an expert. The chairperson never answers questions. They just point at whoever should speak next. The question-asker raises their hand and asks something. The chair points at the expert. The expert says, 'I need to look that up in the filing cabinet first,' so the chair points back at the question-asker, who in this room is also the person who can open the cabinet. They read out what they found, the chair points at the expert again, and the expert gives the final answer. Everyone hears every word; nothing is whispered. The meeting ends when someone says the magic stop phrase.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 minutes: who the manager is, what select_speaker does, why the UserProxy owns tool execution, and how termination is wired.
from autogen import AssistantAgent, UserProxyAgent, GroupChat, GroupChatManager
assistant = AssistantAgent(
name="assistant",
llm_config={"model": "claude-sonnet-4-6"},
)
user = UserProxyAgent(
name="user",
human_input_mode="NEVER",
code_execution_config={"work_dir": "runs", "use_docker": True},
is_termination_msg=lambda m: "TERMINATE" in m.get("content", ""),
)
chat = GroupChat(agents=[user, assistant], messages=[], max_round=12)
manager = GroupChatManager(groupchat=chat, llm_config={"model": "gpt-5.5"})
user.initiate_chat(manager, message="Compute the SHA-256 of 'autogen'. End with TERMINATE.")Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating the UserProxyAgent as only the human relay and forgetting it is also the side that runs tool calls. So disabling code execution silently breaks every tool-using turn.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.