微软AI智能体框架:统一Semantic Kernel与AutoGen的下一代多智能体开发平台
Microsoft Agent Framework is the unified successor to Semantic Kernel and AutoGen, combining their strengths into a single open-source framework for building AI agents and multi-agent workflows in .NET and Python. (Microsoft Agent Framework是Semantic Kernel和AutoGen的统一后继者,将两者的优势结合到一个开源框架中,用于在.NET和Python中构建AI智能体和多智能体工作流。)
Introduction to Microsoft Agent Framework (微软AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.框架简介)
Microsoft Agent Framework is an open-source development kit for building AI agents and multi-agent workflows for .NET and Python. It brings together and extends ideas from Semantic Kernel and AutoGen projects, combining their strengths while adding new capabilities. Built by the same teams, it is the unified foundation for building AI agents going forward.
Microsoft Agent Framework是一个开源开发工具包,用于为.NET和Python构建AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.和多智能体工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。。它汇集并扩展了Semantic Kernel和AutoGen项目的理念,结合了它们的优势,同时增加了新功能。由相同的团队构建,它是未来构建AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.的统一基础。
According to industry reports, the demand for multi-agent AI systems has grown significantly as organizations seek to automate complex business processes that require coordination between multiple AI components.
Why Another Agent Framework? (为何需要新的智能体框架?)
Semantic Kernel and AutoGen pioneered the concepts of AI agents and multi-agent orchestration. The Agent Framework is the direct successor, created by the same teams. It combines AutoGen's simple abstractions for single- and multi-agent patterns with Semantic Kernel's enterprise-grade features such as thread-based state management, type safety, filters, telemetry, and extensive model and embedding support. Beyond merging the two, Agent Framework introduces workflows that give developers explicit control over multi-agent execution paths, plus a robust state management system for long-running and human-in-the-loop scenarios.
Semantic Kernel和AutoGen开创了AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.和多智能体编排协调多个AI智能体协同工作的机制,包括顺序、并发、交接等模式,用于解决单个智能体无法处理的复杂任务。的概念。Agent Framework是直接后继者,由相同的团队创建。它结合了AutoGen针对单智能体和多智能体模式的简单抽象,以及Semantic Kernel的企业级功能,如基于线程的状态管理、类型安全、过滤器、遥测以及广泛的模型和嵌入支持。除了合并两者之外,Agent Framework引入了工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。,为开发者提供对多智能体执行路径的明确控制,以及用于长期运行和人机交互场景的强大状态管理系统。
In short, Agent Framework is the next generation of both Semantic Kernel and AutoGen.
简而言之,Agent Framework是Semantic Kernel和AutoGen的下一代产品。
Core Capabilities Overview (核心能力概述)
Agent Framework offers two primary categories of capabilities:
Agent Framework提供两大类核心能力:
AI Agents (AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.)
An AI agent (AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.) is an individual agent that uses LLMs to process user inputs, call tools and MCP servers to perform actions, and generate responses. Agents support model providers including Azure OpenAI, OpenAI, and Azure AI.
AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.是使用LLM处理用户输入、调用工具和MCP服务器执行操作并生成响应的单个智能体。智能体支持包括Azure OpenAI、OpenAI和Azure AI在内的模型提供商。
The framework also provides foundational building blocks, including:
该框架还提供基础构建块,包括:
- Model clients for chat completions and responses (用于聊天完成和响应的模型客户端)
- An agent thread for state management (用于状态管理的智能体线程)
- Context providers for agent memory (用于智能体记忆的上下文提供者)
- Middleware for intercepting agent actions (用于拦截智能体操作的中间件)
- MCP clients for tool integration (用于工具集成的MCP客户端)
Together, these components give you the flexibility and power to build interactive, robust, and safe AI applications.
Workflows (工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。)
A workflow (工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。) is a graph-based system that connects multiple agents and functions to perform complex, multi-step tasks. Workflows support type-based routing, nesting, checkpointing, and request/response patterns for human-in-the-loop scenarios.
工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。是一个基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务。工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。支持基于类型的路由、嵌套、检查点以及人机交互场景的请求/响应模式。
When to Use AI Agents? (何时使用AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.?)
AI agents are suitable for applications that require autonomous decision-making, ad hoc planning, trial-and-error exploration, and conversation-based user interactions. They are particularly useful for scenarios where the input task is unstructured and cannot be easily defined in advance.
AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.适用于需要自主决策、临时规划、试错探索和基于对话的用户交互的应用。它们特别适用于输入任务非结构化且无法预先轻松定义的场景。
Here are some common scenarios where AI agents excel:
以下是AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.表现出色的一些常见场景:
- Customer Support: AI agents can handle multi-modal queries (text, voice, images) from customers, use tools to look up information, and provide natural language responses. (客户支持:AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.可以处理来自客户的多模态查询(文本、语音、图像),使用工具查找信息,并提供自然语言响应。)
- Education and Tutoring: AI agents can leverage external knowledge bases to provide personalized tutoring and answer student questions. (教育与辅导:AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.可以利用外部知识库提供个性化辅导并回答学生问题。)
- Code Generation and Debugging: For software developers, AI agents can assist with implementation, code reviews, and debugging by using various programming tools and environments. (代码生成与调试:对于软件开发人员,AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.可以通过使用各种编程工具和环境来协助实现、代码审查和调试。)
- Research Assistance: For researchers and analysts, AI agents can search the web, summarize documents, and piece together information from multiple sources. (研究辅助:对于研究人员和分析师,AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.可以搜索网络、总结文档并从多个来源整合信息。)
The key is that AI agents are designed to operate in a dynamic and underspecified setting, where the exact sequence of steps to fulfill a user request is not known in advance and might require exploration and close collaboration with users.
When Not to Use AI Agents? (何时不应使用AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.?)
AI agents are not well-suited for tasks that are highly structured and require strict adherence to predefined rules. If your application anticipates a specific kind of input and has a well-defined sequence of operations to perform, using AI agents might introduce unnecessary uncertainty, latency, and cost.
AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.不太适合高度结构化且需要严格遵守预定义规则的任务。如果您的应用程序预期特定类型的输入并具有明确定义的操作序列,使用AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.可能会引入不必要的不确定性、延迟和成本。
If you can write a function to handle the task, do that instead of using an AI agent. You can use AI to help you write that function.
如果您可以编写函数来处理任务,请这样做而不是使用AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.。您可以使用AI来帮助您编写该函数。
A single AI agent might struggle with complex tasks that involve multiple steps and decision points. Such tasks might require a large number of tools (for example, over 20), which a single agent cannot feasibly manage. In these cases, consider using workflows instead.
What Problems Do Workflows Solve? (工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。解决什么问题?)
Workflows provide a structured way to manage complex processes that involve multiple steps, decision points, and interactions with various systems or agents. The types of tasks workflows are designed to handle often require more than one AI agent.
工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。提供了一种结构化方式来管理涉及多个步骤、决策点以及与各种系统或智能体交互的复杂流程。工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。设计用于处理的任务类型通常需要多个AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.。
Here are some of the key benefits of Agent Framework workflows:
以下是Agent Framework工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。的一些关键优势:
- Modularity: Workflows can be broken down into smaller, reusable components, making it easier to manage and update individual parts of the process. (模块化:工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。可以分解为更小、可重用的组件,使得管理和更新流程的各个部分更加容易。)
- Agent Integration: Workflows can incorporate multiple AI agents alongside non-agentic components, allowing for sophisticated orchestration of tasks. (智能体集成:工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。可以集成多个AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.以及非智能体组件,实现复杂的任务编排。)
- Type Safety: Strong typing ensures messages flow correctly between components, with comprehensive validation that prevents runtime errors. (类型安全:强类型确保消息在组件之间正确流动,通过全面验证防止运行时错误。)
- Flexible Flow: Graph-based architecture allows for intuitive modeling of complex workflows with executors and edges. Conditional routing, parallel processing, and dynamic execution paths are all supported. (灵活流程:基于图的架构允许使用执行器和边直观地建模复杂工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。。支持条件路由、并行处理和动态执行路径。)
- External Integration: Built-in request/response patterns enable seamless integration with external APIs and support human-in-the-loop scenarios. (外部集成:内置的请求/响应模式实现与外部API的无缝集成,并支持人机交互场景。)
- Checkpointing: Save workflow states via checkpoints, enabling recovery and resumption of long-running processes on the server side. (检查点:通过检查点保存工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。状态,实现服务器端长期运行流程的恢复和继续。)
- Multi-Agent Orchestration: Built-in patterns for coordinating multiple AI agents, including sequential, concurrent, hand-off, and Magentic. (多智能体编排协调多个AI智能体协同工作的机制,包括顺序、并发、交接等模式,用于解决单个智能体无法处理的复杂任务。:内置协调多个AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.的模式,包括顺序、并发、交接和Magentic。)
- Composability: Workflows can be nested or combined to create more complex processes, allowing for scalability and adaptability. (可组合性:工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。可以嵌套或组合以创建更复杂的流程,实现可扩展性和适应性。)
Installation and Getting Started (安装与入门)
Python Installation (Python安装)
pip install agent-framework --pre
.NET Installation (.NET安装)
dotnet add package Microsoft.Agents.AI
Important Notes and Considerations (重要注意事项)
Note: Microsoft Agent Framework is currently in public preview. Please submit any feedback or issues on the GitHub repository.
注意:Microsoft Agent Framework目前处于公开预览阶段。请在GitHub仓库提交任何反馈或问题。
Important: If you use Microsoft Agent Framework to build applications that operate with third-party servers or agents, you do so at your own risk. We recommend reviewing all data being shared with third-party servers or agents and being cognizant of third-party practices for retention and location of data. It is your responsibility to manage whether your data will flow outside of your organization's Azure compliance and geographic boundaries and any related implications.
重要:如果您使用Microsoft Agent Framework构建与第三方服务器或智能体交互的应用程序,您需自行承担风险。我们建议审查与第三方服务器或智能体共享的所有数据,并了解第三方的数据保留和位置实践。您有责任管理您的数据是否会流出您组织的Azure合规性和地理边界,以及任何相关影响。
Migration and Community (迁移与社区)
To learn more about migrating from either Semantic Kernel or AutoGen, see the Migration Guide from Semantic Kernel and Migration Guide from AutoGen.
要了解从Semantic Kernel或AutoGen迁移的更多信息,请参阅Semantic Kernel迁移指南和AutoGen迁移指南。
Both Semantic Kernel and AutoGen have benefited significantly from the open-source community, and the same is expected for Agent Framework. Microsoft Agent Framework welcomes contributions and will keep improving with new features and capabilities.
Semantic Kernel和AutoGen都从开源社区中受益匪浅,Agent Framework预计也将如此。Microsoft Agent Framework欢迎贡献,并将通过新功能和能力不断改进。
Frequently Asked Questions (常见问题)
Microsoft Agent Framework与Semantic Kernel和AutoGen有何区别?
Microsoft Agent Framework是Semantic Kernel和AutoGen的统一后继者,结合了两者的优势,增加了工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。控制和更强大的状态管理系统,专为复杂、长期运行的多智能体应用设计。
AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.和工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。的主要应用场景是什么?
AI智能体An autonomous intelligent system that perceives its environment, makes decisions, and executes tasks, characterized by autonomy and adaptability.适用于非结构化、需要自主决策的场景,如客户支持、教育辅导;工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。适用于结构化、多步骤的复杂流程,如业务流程自动化、多智能体协调任务。
框架支持哪些编程语言和模型提供商?
支持.NET和Python编程语言,以及Azure OpenAI、OpenAI和Azure AI等主流模型提供商,具有良好的跨平台兼容性。
工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。如何解决单智能体的局限性?
通过图结构、条件路由、并行处理和检查点机制,工作流基于图的系统,连接多个智能体和函数以执行复杂的多步骤任务,支持类型路由、嵌套、检查点和人机交互模式。可以协调多个智能体,管理复杂决策流程,并支持长期运行任务的状态保存与恢复。
企业使用该框架需要注意哪些安全合规问题?
需注意数据流向第三方服务器的风险,审查数据共享实践,确保符合组织的Azure合规性和地理边界要求,特别是在处理敏感数据时。
版权与免责声明:本文仅用于信息分享与交流,不构成任何形式的法律、投资、医疗或其他专业建议,也不构成对任何结果的承诺或保证。
文中提及的商标、品牌、Logo、产品名称及相关图片/素材,其权利归各自合法权利人所有。本站内容可能基于公开资料整理,亦可能使用 AI 辅助生成或润色;我们尽力确保准确与合规,但不保证完整性、时效性与适用性,请读者自行甄别并以官方信息为准。
若本文内容或素材涉嫌侵权、隐私不当或存在错误,请相关权利人/当事人联系本站,我们将及时核实并采取删除、修正或下架等处理措施。 也请勿在评论或联系信息中提交身份证号、手机号、住址等个人敏感信息。