写点什么

极客说|Azure AI Agent Service 结合 AutoGen/Semantic Kernel 构建多智能体解决⽅案

  • 2025-01-14
    北京
  • 本文字数:1933 字

    阅读完需:约 6 分钟

大小:751.72K时长:04:16
极客说|Azure AI Agent Service 结合 AutoGen/Semantic Kernel 构建多智能体解决⽅案

在 Microsoft Ignite 2024 上,微软发布了 Azure AI Agent Service,我们可以在 Azure AI Foundry 上通过 Azure AI Foundry SDK 及 Azure AI Agent Service 的 UI 直接构建基于智能业务的 AI Agent。


与 Azure AI Assistant API 相比,Azure AI Agent Service 可以让我们拥有更灵活的模型,如可以直接调⽤ Llama 3、Mistral 以及 Cohere 等开源⼤模型,有更好的企业功能接入(Microsoft Fabric、Microsoft SharePoint、Azure AI Search、Microsoft Bing 等),更强的企业安全机制以及数据存储⽅式。



目前 Azure AI Agent Service 处于 Public Preview 阶段,开发者可以通过 Azure AI Foundry SDK,使用 Python 或者 C# 快速构建基于 Azure AI Agent Service 的智能体;企业则基于业务拥有不同的 AI Agents。


那在⼯作流中应该如何组合这些 AI Agents 呢?我们就需要通过 AutoGen 或者 Semantic Kernel 对这三个 AI Agents 进⾏编排。



在 Azure AI Foundry SDK 创建 AI Agent 的技巧


建议使用以下模板在 Azure AI Foundry 中创建项⽬:



https://portal.azure.com/#create/Microsoft.Template


注意


1. 目前 Azure AI Agent Service 处于 Public Preview 阶段,所以我们需要在特定区域和模型中使⽤。



当然你也可以使⽤ Azure AI Foundry model catalog 中的:

  • Llama 3.1-70B-instruct

  • Mistral-large-2407

  • Cohere command R+


2. Azure AI Foundry SDK 现在⽀持 Python / C# 的版本


安 装 Python 的 Azure AI Foundry SDK

pip install azure-ai-projectspip install azure-identity
复制代码

安 装 .NET 的 Azure AI Foundry SDK

dotnet add package Azure.AI.Projects --version 1.0.0-beta.1
复制代码


如果你希望了解如何结合 Azure AI Foundry SDK 创建 AI Agent ,建议参考:

https://learn.microsoft.com/en-us/azure/ai-services/agents/quickstart


下⾯介绍⼀个场景,如⼀个 Blog 创作场景,我们可以围绕该创作场景定义三个 AI Agent Service 服务:内容搜集的 Agent、编写技能的 Agent、以及保存内容功能的 Agent,然后通过 AutoGen / Semantic Kernel 对 AI Agent 进⾏编排。


Azure AI Agent Service 定义单智能体


Azure AI Agent Service 更多是对特定智能任务的单 Agent 进⾏定义,比如你可以定义⼀个数据挖掘的智能体,也可以定义⼀个链接 Azure Function 的智能体,更可以利⽤ Function Calling 接入第三⽅邮件发送服务的智能体等。如上述场景谈及的智能体我们可以这样定义:


🔍 内容搜集的 Agent


内容搜集的 Agent 主要通过搜索引擎来搜索 Blog 提纲的内容,从⽽为 Blog 添加更详细的内容。Azure AI Agent Service 提供了 Grounding with Bing 服务进行扩展,你可以非常简单地接入 Bing 搜索中。



具体实现:

  • Python

https://github.com/kinfey/MultiAIAgent/blob/main/03.AzureAIAgentWithAutoGen01.ipynb

  • C#

https://github.com/kinfey/MultiAIAgent/blob/main/08.AzureAIAgentWithSK01.ipynb


📖编写技能的 Agent


编写技能的 Agent 可以直接通过 LLM 完成编写的内容。



🛠 保存内容功能的 Agent


保存内容功能的 Agent 通过 Azure AI Agent Service 的 code-interpreter 完成内容保存⼯作。



具体实现:

  • Python

https://github.com/kinfey/MultiAIAgent/blob/main/01.AzureAIAgentCode.ipynb

  • C#

https://github.com/kinfey/MultiAIAgent/blob/main/05.AzureAIAgentCodedotNET.ipynb


利⽤ AutoGen / Semantic Kernel 编排多智能体


在企业场景中,我们拥有不同的单智能体,可以协助我们完成不同的工作,同时,基于不同任务又可以组合不同的智能体来完成相关⼯作。如需要发送 Blog,我们可以将上述的三个智能体进⾏组合来完成任务。AutoGen / Semantic Kernel 都支持智能体的编排⼯作,我们可以利⽤ AutoGen 中的 Function Calling / Semantic Kerenl Plugin 进行 Azure AI Agent Service 的绑定来完成上述三个智能体的编排⼯作。


以下是具体架构:


AutoGen 的编排⽅式



示例:

https://github.com/kinfey/MultiAIAgent/blob/main/04.AzureAIAgentWithAutoGen02.ipynb


Semantic Kernel 的编排⽅式



通过编排多智能体,我们可以非常轻松地完成不同需要的⼯作流,这⾥是两个不同的指令,都可以完成博客的编写⼯作。


示例:

https://github.com/kinfey/MultiAIAgent/blob/main/09.AzureAIAgentWithSK02.ipynb


多智能体的结合可以帮助我们快速地完成不同的任务。随着 LLM / SLM 能⼒的增强,也会在企业业务功能上有更好的融合。AI Agent as a Service 将会到来,结合多智能体帮助企业更轻松地构建和部署智能 AI 代理,更快迈进真正的 AI 时代。


更多精彩内容请点击下载

《极客说|微软新模型:Phi-4 来了》

《利用 AI 和 DevOps 重新定义开发人员体验》

《SAP on Microsoft Cloud》

《智能GitHub Copilot副驾驶®提示和技巧》

2025-01-14 10:024609

评论

发布
暂无评论
发现更多内容

读《Software Systems Architecture》(21)—— The Deployment Viewpoint

术子米德

架构师成长笔记

Java中检查字符串是否是有效日期

okokabcd

Java

读《Software Systems Architecture》(22)—— The Operational Viewpoint

术子米德

架构师成长笔记

读《Software Systems Architecture》(24)—— Introduction to the Perspective Catalog

术子米德

架构师成长笔记

读《Software Systems Architecture》(28)—— The Evolution Perspective

术子米德

架构师成长笔记

中台的细节

卢卡多多

中台 6月月更

读《Software Systems Architecture》(14)—— Evaluating the Architecture

术子米德

架构师成长笔记

读《Software Systems Architecture》(17)—— The Functional Viewpoint

术子米德

架构师成长笔记

在线文本保留中文提取过滤工具

入门小站

工具

读《Software Systems Architecture》(12)—— Producing Architectural Models

术子米德

架构师成长笔记

读《Software Systems Architecture》(18)—— The Information Viewpoint

术子米德

架构师成长笔记

读《Software Systems Architecture》(27)—— The Availability and Resilience Perspective

术子米德

架构师成长笔记

莫把功能当能力!从企业架构视角看警察在火锅店站岗

涛哥 数字产品和业务架构

企业架构

python停车时间计算,时分秒计算(split()函数)

写代码两年半

Python 6月月更

读《Software Systems Architecture》(11)—— Using Styles and Patterns

术子米德

架构师成长笔记

读《Software Systems Architecture》(16)—— The Context Viewpoint

术子米德

架构师成长笔记

读《Software Systems Architecture》(26)—— The Performance and Scalability Perspective

术子米德

架构师成长笔记

Java Core 「8」字节码增强技术

Samson

学习笔记 Java core 6月月更

flutter系列之:Material中的3D组件Card

程序那些事

flutter 程序那些事 6月月更

JVM调优简要思想及简单案例-JVM是什么?

zarmnosaj

6月月更

在线JSON转TSV工具

入门小站

工具

读《Software Systems Architecture》(23)—— Archiving Consistency Across Views

术子米德

架构师成长笔记

[数据分析实践]-文本分析-U.S. Patent Phrase-1

浩波的笔记

数据分析

读《Software Systems Architecture》(19)—— The Concurrency Viewpoint

术子米德

架构师成长笔记

力扣每日一练之二维数组上篇Day4

京与旧铺

6月月更

c语言选择,循环语句概述

工程师日月

6月月更

读《Software Systems Architecture》(13)—— Creating the Architectural Description

术子米德

架构师成长笔记

读《Software Systems Architecture》(25)—— The Security Perspective

术子米德

架构师成长笔记

远程办公-如何提高开会效率?| 社区征文

石云升

远程办公 开会 会议 6月月更 初夏征文

读《Software Systems Architecture》(15)—— Introduction to the Viewpoint Catalog

术子米德

架构师成长笔记

读《Software Systems Architecture》(20)—— The Development Viewpoint

术子米德

架构师成长笔记

极客说|Azure AI Agent Service 结合 AutoGen/Semantic Kernel 构建多智能体解决⽅案_微软_微软中国MSDN_InfoQ精选文章