项目已归档不再维护,官方建议新项目改用 Microsoft Agent Framework;示例依赖 OpenAI API,需先 export OPENAI_API_KEY;MCP 示例需先 npm install -g @playwright/mcp@latest;AutoGen Studio 默认跑在 8080 端口且明确非生产可用
pip install -U "autogen-agentchat" "autogen-ext[openai]"README 未说明显存或 GPU 要求;示例通过 OpenAI API 调用云端模型,本地只需 Python 3.10 或更高版本
微软开源的多智能体 AI 应用框架,用分层 API 编排多个 Agent 协作完成任务
微软开源的多智能体编程框架,让开发者用对话编排多个 LLM Agent 协作完成复杂任务,支持自定义角色与工具调用。
核心能力
- 用 Core API 实现事件驱动 Agent 与本地/分布式运行时
- 用 AgentChat API 快速搭建双人对话、群聊等多智能体模式
- 通过 Extensions 接入 OpenAI、AzureOpenAI 等模型与代码执行
- 用 AgentTool 把专家 Agent 包装成工具做多智能体编排
- 内置 AutoGen Studio 无代码 GUI 与 AutoGen Bench 评测套件
容易踩的坑
- python-v0.7.5最新正式版2025-09-30 · 2025-09-30 06:18 UTC
What's Changed
- Fix docs dotnet core typo by @lach-g in https://github.com/microsoft/autogen/pull/6950
- Fix loading streaming Bedrock response with tool usage with empty argument by @pawel-dabro in https://github.com/microsoft/autogen/pull/6979
- Support linear memory in RedisMemory by @justin-cechmanek in https://github.com/microsoft/autogen/pull/6972
- Fix message ID for correlation between streaming chunks and final mes… by @smalltalkman in https://github.com/microsoft/autogen/pull/6969
- fix: extra args not work to disable thinking by @liuyunrui123 in https://github.com/microsoft/autogen/pull/7006
- Add thinking mode support for anthropic client by @SrikarMannepalli in https://github.com/microsoft/autogen/pull/7002
- Fix spurious tags caused by empty string reasoning_content in streaming by @Copilot in https://github.com/microsoft/autogen/pull/7025
- Fix GraphFlow cycle detection to properly clean up recursion state by @Copilot in https://github.com/microsoft/autogen/pull/7026
- Add comprehensive GitHub Copilot instructions for AutoGen development by @Copilot in https://github.com/microsoft/autogen/pull/7029
- Fix Redis caching always returning False due to unhandled string values by @Copilot in https://github.com/microsoft/autogen/pull/7022
- Fix OllamaChatCompletionClient load_component() error by adding to WELL_KNOWN_PROVIDERS by @Copilot in https://github.com/microsoft/autogen/pull/7030
- Fix finish_reason logic in Azure AI client streaming response by @litterzhang in https://github.com/microsoft/autogen/pull/6963
- Add security warnings and default to DockerCommandLineCodeExecutor by @ekzhu in https://github.com/microsoft/autogen/pull/7035
- Fix: Handle nested objects in array items for JSON schema conversion by @kkutrowski in https://github.com/microsoft/autogen/pull/6993
- Fix not supported field warnings in count_tokens_openai by @seunggil1 in https://github.com/microsoft/autogen/pull/6987
- Fix(mcp): drain pending command futures on McpSessionActor failure by @withsmilo in https://github.com/microsoft/autogen/pull/7045
- Add missing reasoning_effort parameter support for OpenAI GPT-5 models by @Copilot in https://github.com/microsoft/autogen/pull/7054
- Update version to 0.7.5 by @ekzhu in https://github.com/microsoft/autogen/pull/7058
New Contributors
- @lach-g made their first contribution in https://github.com/microsoft/autogen/pull/6950
- @pawel-dabro made their first contribution in https://github.com/microsoft/autogen/pull/6979
- @smalltalkman made their first contribution in https://github.com/microsoft/autogen/pull/6969
- @liuyunrui123 made their first contribution in https://github.com/microsoft/autogen/pull/7006
- @SrikarMannepalli made their first contribution in https://github.com/microsoft/autogen/pull/7002
- @litterzhang made their first contribution in https://github.com/microsoft/autogen/pull/6963
- @kkutrowski made their first contribution in https://github.com/microsoft/autogen/pull/6993
- @seunggil1 made their first contribution in https://github.com/microsoft/autogen/pull/6987
Full Changelog: https://github.com/microsoft/autogen/compare/python-v0.7.4...python-v0.7.5
- python-v0.7.42025-08-19 · 2025-08-19 18:50 UTC
查看更新说明
What's Changed
- Update docs for 0.7.3 by @ekzhu in https://github.com/microsoft/autogen/pull/6948
- Update readme with agent-as-tool by @ekzhu in https://github.com/microsoft/autogen/pull/6949
- Fix Redis Deserialization Error by @BenConstable9 in https://github.com/microsoft/autogen/pull/6952
- Redis Doesn't Support Streaming by @BenConstable9 in https://github.com/microsoft/autogen/pull/6954
- update version to 0.7.4 by @ekzhu in https://github.com/microsoft/autogen/pull/6955
- Update doc 0.7.4 by @ekzhu in https://github.com/microsoft/autogen/pull/6956
New Contributors
- @BenConstable9 made their first contribution in https://github.com/microsoft/autogen/pull/6952
Full Changelog: https://github.com/microsoft/autogen/compare/python-v0.7.3...python-v0.7.4
- python-v0.7.32025-08-19 · 2025-08-19 08:07 UTC
查看更新说明
What's Changed
- Update website for 0.7.2 by @ekzhu in https://github.com/microsoft/autogen/pull/6902
- Typo in docs for 'NoOpTracerProvider' by @nicsuzor in https://github.com/microsoft/autogen/pull/6915
- Fix MCP example in readme by @ekzhu in https://github.com/microsoft/autogen/pull/6919
- Extend pydantic model capability for anyOf/oneOf item typing by @fiow123 in https://github.com/microsoft/autogen/pull/6925
- Update README.md with correct stable version by @Jp3132 in https://github.com/microsoft/autogen/pull/6942
- fix: Add proper serialization to RedisStore for complex objects by @tejas-dharani in https://github.com/microsoft/autogen/pull/6905
- Fix OpenAIAgent function tool schema by @alexey-pelykh in https://github.com/microsoft/autogen/pull/6936
- Add model info for gpt-5 by @ekzhu in https://github.com/microsoft/autogen/pull/6945
- Update OpenAIAgent to reflect gap in supporting custom function tool by @ekzhu in https://github.com/microsoft/autogen/pull/6943
- Ensure task runner tools are always strict by @ekzhu in https://github.com/microsoft/autogen/pull/6946
- Update version to 0.7.3 by @ekzhu in https://github.com/microsoft/autogen/pull/6947
New Contributors
- @nicsuzor made their first contribution in https://github.com/microsoft/autogen/pull/6915
- @fiow123 made their first contribution in https://github.com/microsoft/autogen/pull/6925
- @Jp3132 made their first contribution in https://github.com/microsoft/autogen/pull/6942
- @alexey-pelykh made their first contribution in https://github.com/microsoft/autogen/pull/6936
Full Changelog: https://github.com/microsoft/autogen/compare/python-v0.7.2...python-v0.7.3
- python-v0.7.22025-08-07 · 2025-08-07 00:29 UTC
查看更新说明
What's Changed
- Update website 0.7.1 by @ekzhu in https://github.com/microsoft/autogen/pull/6869
- Update OpenAIAssistantAgent doc by @ekzhu in https://github.com/microsoft/autogen/pull/6870
- Update 0.7.1 website ref by @ekzhu in https://github.com/microsoft/autogen/pull/6871
- Remove assistant related methods from OpenAIAgent by @ekzhu in https://github.com/microsoft/autogen/pull/6866
- Make DockerCommandLineCodeExecutor the default for MagenticOne team by @Copilot in https://github.com/microsoft/autogen/pull/6684
- Add approval_func option to CodeExecutorAgent by @ekzhu in https://github.com/microsoft/autogen/pull/6886
- Add documentation warnings for AgentTool/TeamTool parallel tool calls limitation by @Copilot in https://github.com/microsoft/autogen/pull/6883
- Add parallel_tool_call to openai model client config by @ekzhu in https://github.com/microsoft/autogen/pull/6888
- Fix structured logging serialization data loss with SerializeAsAny annotations by @Copilot in https://github.com/microsoft/autogen/pull/6889
- Update version 0.7.2 by @ekzhu in https://github.com/microsoft/autogen/pull/6895
- Adds support for JSON and MARKDOWN in Redis agent memory by @justin-cechmanek in https://github.com/microsoft/autogen/pull/6897
- Add warning for MCP server docs by @ekzhu in https://github.com/microsoft/autogen/pull/6901
Full Changelog: https://github.com/microsoft/autogen/compare/python-v0.7.1...python-v0.7.2
- python-v0.7.12025-07-28 · 2025-07-28 08:43 UTC
查看更新说明
What's New
OpenAIAgentsupports all built-in tools- Feat/OpenAI agent builtin tools 6657 by @tejas-dharani in https://github.com/microsoft/autogen/pull/6671
Support nested
Teamas a participant in aTeam- Supporting Teams as Participants in a GroupChat by @ekzhu in https://github.com/microsoft/autogen/pull/5863
Introduce
RedisMemory- Adds Redis Memory extension class by @justin-cechmanek in https://github.com/microsoft/autogen/pull/6743
Upgrade to latest MCP version
- Upgrade_mcp_version by @victordibia in https://github.com/microsoft/autogen/pull/6814
- Expand MCP Workbench to support more MCP Client features by @tylerpayne in https://github.com/microsoft/autogen/pull/6785
Upgrade to latest GraphRAG version
- Upgrade GraphRAG to v2.3+ by @victordibia in https://github.com/microsoft/autogen/pull/6744
include_name_in_messageflag to make the use ofnamefield optional in chat messages sent via the Open AI client.- Add
include_name_in_messageparameter to makenamefield optional in OpenAI messages by @Copilot in https://github.com/microsoft/autogen/pull/6845
All Changes
- Feat/OpenAI agent builtin tools 6657 by @tejas-dharani in https://github.com/microsoft/autogen/pull/6671
- Setup publishing for pyautogen package by @ekzhu in https://github.com/microsoft/autogen/pull/6813
- In Add required termination condition and missing agent_e by @dave-howard in https://github.com/microsoft/autogen/pull/6809
- Fix JSON serialization of team state by handling datetime objects in message dump by @Copilot in https://github.com/microsoft/autogen/pull/6797
- Upgrade_mcp_version by @victordibia in https://github.com/microsoft/autogen/pull/6814
- Update AGS (Support Workbenches ++) by @victordibia in https://github.com/microsoft/autogen/pull/6736
- feat: add timeout for http tools by @lo5twind in https://github.com/microsoft/autogen/pull/6818
- Expand MCP Workbench to support more MCP Client features by @tylerpayne in https://github.com/microsoft/autogen/pull/6785
- Deprecating openai assistant agent. Apply version conditioned import for open ai version < 1.83 by @ekzhu in https://github.com/microsoft/autogen/pull/6827
- Fix OpenAI UnprocessableEntityError when AssistantAgent makes multiple tool calls by @Copilot in https://github.com/microsoft/autogen/pull/6799
- fix: use correct format when adding memory to mem0 by @savy-91 in https://github.com/microsoft/autogen/pull/6831
- Adds Redis Memory extension class by @justin-cechmanek in https://github.com/microsoft/autogen/pull/6743
- Add support for
"format": "json"in JSON schemas by @onematchfox in https://github.com/microsoft/autogen/pull/6846 - docs: correct function spelling by @savy-91 in https://github.com/microsoft/autogen/pull/6849
- Add
include_name_in_messageparameter to makenamefield optional in OpenAI messages by @Copilot in https://github.com/microsoft/autogen/pull/6845 - upgrade graphrag sample to v2.3+ by @victordibia in https://github.com/microsoft/autogen/pull/6744
- fix: load agent correctly in test service by @zrquan in https://github.com/microsoft/autogen/pull/6860
- Update installation guide in _openai_assistant_agent.py by @ekzhu in https://github.com/microsoft/autogen/pull/6863
- fix: use ```sh consistently by @zrquan in https://github.com/microsoft/autogen/pull/6864
- Supporting Teams as Participants in a GroupChat by @ekzhu in https://github.com/microsoft/autogen/pull/5863
- Update version to 0.7.0 by @ekzhu in https://github.com/microsoft/autogen/pull/6865
- Bring back OpenAIAssistantAgent by @ekzhu in https://github.com/microsoft/autogen/pull/6867
- Update version to 0.7.1 by @ekzhu in https://github.com/microsoft/autogen/pull/6868
New Contributors
- @dave-howard made their first contribution in https://github.com/microsoft/autogen/pull/6809
- @lo5twind made their first contribution in https://github.com/microsoft/autogen/pull/6818
- @tylerp
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
AutoGen 
AutoGen is a framework for creating multi-agent AI applications that can act autonomously or work alongside humans.
[!CAUTION] ⚠️ Project archived and no longer maintained
This project has been archived and is no longer actively maintained by Microsoft.
Microsoft is not providing bug fixes, security fixes, new features, or support for this project. The repository remains available for historical/reference purposes.
Use archived repositories with caution. Without ongoing maintenance or security fixes, vulnerabilities in this project and its dependencies may remain unaddressed, increasing the security risks of continued use. Carefully assess these risks before using AutoGen, particularly when handling sensitive data. AutoGen was developed for research and experimentation and as it transitions to archived, we continue to advise against production use.
We thank the AutoGen community for the code, documentation, bug reports, ideas, and discussions that helped shape this project.
New users should start with Microsoft Agent Framework. Existing users are encouraged to migrate using the AutoGen → Microsoft Agent Framework migration guide.
Microsoft Agent Framework (MAF) is the enterprise‑ready successor to AutoGen. Microsoft Agent FrameworkAF in now available as a production-ready release: stable APIs, and a commitment to long-term support. Whether you're building a single assistant or orchestrating a fleet of specialized agents, Microsoft Agent Framework 1.0 gives you enterprise-grade multi-agent orchestration, multi-provider model support, and cross-runtime interoperability via A2A and MCP.
Installation
AutoGen requires Python 3.10 or later.
# Install AgentChat and OpenAI client from Extensions
pip install -U "autogen-agentchat" "autogen-ext[openai]"
The current stable version can be found in the releases. If you are upgrading from AutoGen v0.2, please refer to the Migration Guide for detailed instructions on how to update your code and configurations.
# Install AutoGen Studio for no-code GUI
pip install -U "autogenstudio"
Quickstart
The following samples call OpenAI API, so you first need to create an account and export your key as export OPENAI_API_KEY="sk-...".
Hello World
Create an assistant agent using OpenAI's GPT-4o model. See other supported models.
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
async def main() -> None:
model_client = OpenAIChatCompletionClient(model="gpt-4.1")
agent = AssistantAgent("assistant", model_client=model_client)
print(await agent.run(task="Say 'Hello World!'"))
await model_client.close()
asyncio.run(main())
MCP Server
Create a web browsing assistant agent that uses the Playwright MCP server.
# First run `npm install -g @playwright/mcp@latest` to install the MCP server.
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import McpWorkbench, StdioServerParams
async def main() -> None:
model_client = OpenAIChatCompletionClient(model="gpt-4.1")
server_params = StdioServerParams(
command="npx",
args=[
"@playwright/mcp@latest",
"--headless",
],
)
async with McpWorkbench(server_params) as mcp:
agent = AssistantAgent(
"web_browsing_assistant",
model_client=model_client,
workbench=mcp, # For multiple MCP servers, put them in a list.
model_client_stream=True,
max_tool_iterations=10,
)
await Console(agent.run_stream(task="Find out how many contributors for the microsoft/autogen repository"))
asyncio.run(main())
Warning: Only connect to trusted MCP servers as they may execute commands in your local environment or expose sensitive information.
Multi-Agent Orchestration
You can use AgentTool to create a basic multi-agent orchestration setup.
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.tools import AgentTool
from autogen_agentchat.ui import Console
from autogen_ext.models.openai import OpenAIChatCompletionClient
async def main() -> None:
model_client = OpenAIChatCompletionClient(model="gpt-4.1")
math_agent = AssistantAgent(
"math_expert",
model_client=model_client,
system_message="You are a math expert.",
description="A math expert assistant.",
model_client_stream=True,
)
math_agent_tool = AgentTool(math_agent, return_value_as_last_message=True)
chemistry_agent = AssistantAgent(
"chemistry_expert",
model_client=model_client,
system_message="You are a chemistry expert.",
description="A chemistry expert assistant.",
model_client_stream=True,
)
chemistry_agent_tool = AgentTool(chemistry_agent, return_value_as_last_message=True)
agent = AssistantAgent(
"assistant",
system_message="You are a general assistant. Use expert tools when needed.",
model_client=model_client,
model_client_stream=True,
tools=[math_agent_tool, chemistry_agent_tool],
max_tool_iterations=10,
)
await Console(agent.run_stream(task="What is the integral of x^2?"))
await Console(agent.run_stream(task="What is the molecular weight of water?"))
asyncio.run(main())
For more advanced multi-agent orchestrations and workflows, read AgentChat documentation.
AutoGen Studio
Use AutoGen Studio to prototype and run multi-agent workflows without writing code.
Caution: AutoGen Studio is meant to help you rapidly prototype multi-agent workflows and demonstrate an example of end user interfaces built with AutoGen. It is not meant to be a production-ready app. Developers are encouraged to use the AutoGen framework to build their own applications, implementing authentication, security and other features required for deployed applications. See the security note for more details.
# Run AutoGen Studio on http://localhost:8080
autogenstudio ui --port 8080 --appdir ./my-app
Why AutoGen?
Pioneered in Microsoft Research, AutoGen opened the door to experimental multi-agent orchestration patterns that inspired the community. AutoGen is now archived and no longer maintained by Microsoft; the architecture described below remains available for historical/reference purposes. For new projects, we recommend Microsoft Agent Framework, which builds on the lessons learned from AutoGen with enterprise-grade support.
The autogen framework uses a layered and extensible design. Layers have clearly divided responsibilities and build on top of layers below. This design enables you to use the framework at different levels of abstraction, from high-level APIs to low-level components.
- Core API implements message passing, event-driven agents, and local and distributed runtime for flexibility and power. It also support cross-language support for .NET and Python.
- AgentChat API implements a simpler but opinionated API for rapid prototyping. This API is built on top of the Core API and is closest to what users of v0.2 are familiar with and supports common multi-agent patterns such as two-agent chat or group chats.
- Extensions API enables first- and third-party extensions continuously expanding framework capabilities. It support specific implementation of LLM clients (e.g., OpenAI, AzureOpenAI), and capabilities such as code execution.
The ecosystem also supports two essential developer tools:
- AutoGen Studio provides a no-code GUI for building multi-agent applications.
- AutoGen Bench provides a benchmarking suite for evaluating agent performance.
You can use the AutoGen framework and developer tools to create applications for your domain. For example, Magentic-One is a state-of-the-art multi-agent team built using AgentChat API and Extensions API that can handle a variety of tasks that require web browsing, code execution, and file handling.
For community support, visit our Discord server or GitHub Discussions. Note that AutoGen is now community-managed and responses may be limited.
Where to go next?
Starting a new project? Head to Microsoft Agent Framework for the latest multi-agent capabilities with long-term support.
Existing AutoGen user? Use the migration guide to transition, or refer to the resources below for current AutoGen documentation.
| Installation | |||
| Quickstart | |||
| Tutorial | |||
| API Reference | |||
| Packages |
Interested in contributing? See CONTRIBUTING.md for guidelines. As AutoGen is in maintenance mode, contributions are limited to bug fixes, security patches, and documentation improvements. For feature development, consider contributing to Microsoft Agent Framework.
Have questions? Check out our Frequently Asked Questions (FAQ) for answers to common queries. Community support is available through GitHub Discussions and the Discord server, though response times may vary as AutoGen is now community-managed. For actively supported tooling, see Microsoft Agent Framework.
Legal Notices
Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the Creative Commons Attribution 4.0 International Public License, see the LICENSE file, and grant you a license to any code in the repository under the MIT License, see the LICENSE-CODE file.
Microsoft, Windows, Microsoft Azure, and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.
Privacy information can be found at https://go.microsoft.com/fwlink/?LinkId=521839
Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel, or otherwise.