AutoGen (Microsoft)

raw JSON →
0.7.5 verified Mon May 11 auth: no python install: reviewed quickstart: verified

Microsoft's framework for building multi-agent AI applications. As of v0.4+, AutoGen is a layered system: autogen-core (event-driven actor runtime), autogen-agentchat (high-level conversational agents), and autogen-ext (extensions for OpenAI, Azure, MCP, etc.). Completely async. The 0.2 API is a separate, deprecated architecture. NOT the same as AG2.

pip install -U "autogen-agentchat" "autogen-ext[openai]"
error ModuleNotFoundError: No module named 'autogen.agentchat'
cause The 'autogen.agentchat' module is not found because the package is installed under a different name or version.
fix
Ensure you have installed the correct package version using 'pip install autogen-agentchat==0.7.5'.
error ImportError: cannot import name 'AssistantAgent' from 'autogen.agentchat'
cause The 'AssistantAgent' class has been moved or renamed in the newer version of the library.
fix
Update your import statement to 'from autogen_agentchat.agents import AssistantAgent'.
error AttributeError: module 'autogen.agentchat' has no attribute 'run_group_chat'
cause The 'run_group_chat' function is not available in the 'autogen.agentchat' module.
fix
Ensure you are using the correct module and function by referring to the latest documentation.
error TypeError: run_group_chat() got an unexpected keyword argument 'safeguard_policy'
cause The 'run_group_chat' function does not accept a 'safeguard_policy' argument in the current version.
fix
Remove the 'safeguard_policy' argument from the 'run_group_chat' function call.
error NameError: name 'ConversableAgent' is not defined
cause The 'ConversableAgent' class is not defined or imported in the current scope.
fix
Import 'ConversableAgent' using 'from autogen_agentchat.agents import ConversableAgent'.
breaking AutoGen v0.4+ is a complete ground-up rewrite with a fully incompatible API from v0.2. All v0.2 imports (from autogen.agentchat, autogen.oai, AssistantAgent with llm_config dict, UserProxyAgent) are broken in v0.4.
fix Follow the official migration guide: https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/migration-guide.html
breaking All v0.4+ AutoGen APIs are fully async. Calling agent.run() without await in an async context, or calling it in a sync context without asyncio.run(), will fail or produce no output.
fix Always use asyncio.run(main()) at the entry point. Use await for all agent calls.
breaking OpenAIChatCompletionClient is in autogen-ext, not autogen-agentchat. pip install autogen-agentchat alone is insufficient — model clients require autogen-ext[openai] or the relevant provider extra.
fix pip install 'autogen-ext[openai]' for OpenAI/OpenAI-compatible models. Use 'autogen-ext[azure]' for Azure OpenAI, 'autogen-ext[anthropic]' for Claude.
breaking pyautogen on PyPI is no longer maintained by Microsoft as of v0.2.34+. Control of that package was lost to an AG2-affiliated fork. Do not use pyautogen for Microsoft AutoGen.
fix Install via autogen-agentchat (for v0.4+) or autogen-agentchat~=0.2 (for legacy v0.2). Never use pyautogen.
gotcha AG2 (pip install ag2 or pip install autogen) is a community fork of AutoGen 0.2, NOT Microsoft's AutoGen 0.4. The autogen PyPI package is currently controlled by the AG2 project. Code written for AG2 and code written for Microsoft AutoGen 0.4 are NOT compatible.
fix For Microsoft AutoGen 0.4+, install autogen-agentchat and autogen-ext. For AG2/legacy API, install ag2 or pin autogen-agentchat~=0.2.
gotcha LLM-generated AutoGen code is highly unreliable. Most AI assistants (as of early 2026) mix v0.2 and v0.4 imports, use wrong module paths (autogen_core.components vs autogen_core), or use synchronous patterns on async-only APIs.
fix Always verify against the official docs at https://microsoft.github.io/autogen/stable/
gotcha model_client.close() must be explicitly called after use to avoid resource leaks. The client does not auto-close.
fix Use try/finally or async context managers: async with OpenAIChatCompletionClient(...) as client: ...
breaking Installing certain dependencies (e.g., numpy, which is a dependency of tiktoken used by autogen-ext[openai]) in minimal Linux environments like Alpine requires build tools. Without them, package installation will fail due to missing compilers.
fix Ensure that necessary build tools are installed in your environment. For Alpine Linux, this typically means running `apk add build-base` before installing Python packages. Example Dockerfile: `FROM python:3.13-alpine RUN apk add build-base RUN pip install autogen-agentchat 'autogen-ext[openai]'`
pip install -U autogen-core
pip install -U autogenstudio
python os / libc status wheel install import disk
3.10 alpine (musl) - - 2.88s 83.3M
3.10 alpine (musl) - - - -
3.10 alpine (musl) - - 2.38s 195.5M
3.10 slim (glibc) - - 1.93s 84M
3.10 slim (glibc) - - - -
3.10 slim (glibc) - - 2.23s 696M
3.11 alpine (musl) - - 3.27s 89.8M
3.11 alpine (musl) - - - -
3.11 alpine (musl) - - - -
3.11 slim (glibc) - - 2.95s 90M
3.11 slim (glibc) - - - -
3.11 slim (glibc) - - 3.14s 683M
3.12 alpine (musl) - - 4.00s 80.6M
3.12 alpine (musl) - - - -
3.12 alpine (musl) - - 3.07s 197.1M
3.12 slim (glibc) - - 3.31s 81M
3.12 slim (glibc) - - - -
3.12 slim (glibc) - - 3.78s 667M
3.13 alpine (musl) - - 3.69s 80.2M
3.13 alpine (musl) - - - -
3.13 alpine (musl) - - - -
3.13 slim (glibc) - - 3.13s 81M
3.13 slim (glibc) - - - -
3.13 slim (glibc) - - 3.58s 665M
3.9 alpine (musl) - - - -
3.9 alpine (musl) - - - -
3.9 alpine (musl) - - - -
3.9 slim (glibc) - - - -
3.9 slim (glibc) - - - -
3.9 slim (glibc) - - - -

Single AssistantAgent with OpenAI — v0.4+ API

import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient

async def main() -> None:
    model_client = OpenAIChatCompletionClient(model='gpt-4o')
    agent = AssistantAgent('assistant', model_client=model_client)
    result = await agent.run(task='Say Hello World!')
    print(result)
    await model_client.close()

asyncio.run(main())