AutoGen Expert Skill

SkillAI & models

Build conversational multi-agent systems with Microsoft AutoGen. AssistantAgent, UserProxyAgent, GroupChat, code execution, nested chats, cancellation tokens, tool integration, and MCP support. Use when building conversation-driven multi-agent systems or comparing agent frameworks. Do not use this skill for unrelated requests; route to the nearest named specialist.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the AutoGen Expert Skill skill

What this skill tells your AI

The instructions your AI receives, as published by magnus919/agent-skills in autogen/SKILL.md and read by ahel’s review.

AutoGen (by Microsoft Research) is a framework for conversational multi-agent AI. Unlike LangGraph's explicit graph topology or CrewAI's role-based crews, AutoGen uses agent-to-agent conversations as the orchestration primitive. Agents communicate through structured chat, with built-in patterns for nested conversations, group chat with routing, and code execution.

Core Paradigm

from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console
from autogen_ext.models.openai import OpenAIChatCompletionClient

model_client = OpenAIChatCompletionClient(model="gpt-4o-mini")

assistant = AssistantAgent(
    name="assistant",
    system_message="You are a helpful assistant.",
    model_client=model_client,
)

⚠️ UserProxyAgent is NOT a human user. It is an automated proxy that can execute code. Despite the name, it runs autonomously unless human_input_mode is set to ALWAYS.

Core Principles

  1. Conversations are the orchestration primitive. Agents send messages, receive replies, and the conversation structure determines the workflow.
  2. UserProxyAgent is a code executor, not a human. Despite the name, it runs autonomously by default. Set human_input_mode="ALWAYS" for actual human-in-the-loop.
  3. GroupChat routes between agents. RoundRobinGroupChat cycles fixed-order. SelectorGroupChat uses an LLM to pick the next speaker.
  4. Nested chats delegate work. An agent can spawn a sub-conversation between specialist agents and return the result.
  5. Docker is the safe code execution mode. Local code execution (LocalCommandLineCodeExecutor) runs LLM-generated code on your machine — use Docker in production.
  6. Cancellation tokens stop runaway agents. Always pass CancellationToken for long-running tasks.

Where to Start

You already have...Start here
Nothing — exploring AutoGenCreate a two-agent chat (Assistant + UserProxy)
Agents that need to coordinateBuild a GroupChat with multiple agents
Agents that need code executionConfigure Docker code executor
A complex multi-step taskUse nested chats for sub-tasks

Quick Reference

TaskApproachReference
Two-agent chatAssistantAgent + UserProxyAgentreferences/agent-types.md
Multi-agent groupGroupChat with RoundRobinGroupChatreferences/group-chat.md
Code executionDockerCommandLineCodeExecutorreferences/code-execution.md
Tool integrationregister_function() or @toolreferences/tool-integration.md
Nested chatinitiate_chat() from within a toolreferences/conversation-patterns.md
CancellationCancellationTokenreferences/conversation-patterns.md
MCP toolsMcpWorkbenchreferences/tool-integration.md

Framework Routing Guide

ScenarioReach forWhy
Conversation-driven multi-agentAutoGenNative agent-to-agent chat as orchestration
Role-based multi-agent teamsCrewAIRole/Goal/Backstory is the native abstraction
State-machine multi-agentLangGraphGraph topology, subgraphs, human-in-the-loop
Chain/agent compositionLangChainLCEL pipe operator for general chains

Reference Files

ReferenceLoad whenFile
Agent TypesAssistantAgent, UserProxyAgentreferences/agent-types.md
Conversation PatternsSend/receive, nested chats, cancellationreferences/conversation-patterns.md
Group ChatRoundRobin, Selector, MagenticOnereferences/group-chat.md
Code ExecutionDocker, local, cancellation tokensreferences/code-execution.md
Tool Integrationregister_function, @tool, MCP integrationreferences/tool-integration.md
v0.4 Migrationv0.2->v0.4 migration, AgentTool, streaming, terminationreferences/v04-migration.md
Validation AuditResearch validation of all API claimsreferences/validation-audit.md
FAQ & TroubleshootingCommon errors and fixesreferences/faq-and-troubleshooting.md

Templates

TemplateWhen to useFile
Two-Agent ChatSimple assistant + code executortemplates/two-agent-chat.py
Group ChatMulti-agent team with speaker routingtemplates/group-chat.py
Code Execution AgentAgent with Docker code executiontemplates/code-execution.py

Troubleshooting

SymptomLikely causeFixReference
Agent loops foreverNo termination conditionAdd is_termination_msg or max_turnsreferences/conversation-patterns.md
Code execution failsDocker not runningStart Docker or use LocalCommandLineCodeExecutorreferences/code-execution.md
Nested chat never returnsCancellation token not passedPass CancellationToken with timeoutreferences/conversation-patterns.md
v0.2 code doesn't workv0.4 API changedFollow migration guidereferences/faq-and-troubleshooting.md
GroupChat speaker selection loopsSelectorGroupChat with no clear nextUse RoundRobinGroupChat for fixed orderreferences/group-chat.md
UserProxyAgent asking for inputhuman_input_mode="ALWAYS"Set to "NEVER" for automated executionreferences/agent-types.md

When NOT to Use AutoGen

  • Simple single-agent task — overkill, use direct API call
  • Need fine-grained graph control — use LangGraph
  • Need role-based teams with fixed processes — use CrewAI
  • Need chain composition — use LangChain LCEL

Signals

GitHub stars
78
Forks
8
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
autogen
Source
github.com/magnus919/agent-skills