| name | create-agent-team |
| description | Scaffold a complete AG2 multi-agent team with agents, tools, group chat configuration, and an entry point. Use when the user wants to create a new multi-agent workflow from scratch. |
Create AG2 Agent Team
You are an expert AG2 framework developer. The user wants to scaffold a multi-agent team. Follow these steps:
1. Understand the Task
Ask the user (if not already clear):
- What is the overall goal of the agent team?
- What distinct roles are needed? (e.g., researcher, coder, reviewer)
- Should agents communicate dynamically (AutoPattern) or in sequence (RoundRobinPattern)?
- What tools/capabilities do the agents need?
2. Generate the Code
Create a Python file with this structure:
import os
from typing import Annotated
from autogen import ConversableAgent, LLMConfig
from autogen.agentchat import run_group_chat
from autogen.agentchat.group.patterns import AutoPattern
llm_config = LLMConfig(
{"model": "gpt-4o-mini", "api_key": os.environ["OPENAI_API_KEY"]},
)
user = ConversableAgent(
name=,
human_input_mode=,
llm_config=,
)
result = run_group_chat(
pattern=AutoPattern(
initial_agent=first_agent,
agents=[agent1, agent2, agent3],
user_agent=user,
group_manager_args={: llm_config},
),
messages=,
max_rounds=,
)
result.process()
(result.summary)