Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
正式リリースされた Semantic Kernel の Agent Framework 全部紹介!
Search
Kazuki
May 09, 2025
Technology
0
210
正式リリースされた Semantic Kernel の Agent Framework 全部紹介!
Global Azure 2025 で使用した登壇資料です。
https://jazug.connpass.com/event/348980/
Kazuki
May 09, 2025
Tweet
Share
More Decks by Kazuki
See All by Kazuki
.NET のUnified AI Building Blocks 入門...!
okazuki
0
250
Semantic Kernel の Agent 機能試してみた!
okazuki
1
740
.NET Aspire を始めよう
okazuki
0
390
空のプロジェクトから始める Blazor
okazuki
1
510
.NET Aspire を使おう!
okazuki
0
290
Semantic Kernel を使って ChatGPT Plugins をアプリに組み込んでみよう
okazuki
1
850
Other Decks in Technology
See All in Technology
品質文化を支える小さいクロスファンクショナルなチーム / Cross-functional teams fostering quality culture
toma_sm
0
180
本当に必要なのは「QAという技術」だった!試行錯誤から生まれた、品質とデリバリーの両取りアプローチ / Turns Out, "QA as a Discipline" Was the Key!
ar_tama
2
170
Part2 GitHub Copilotってなんだろう
tomokusaba
0
230
GraphQLを活用したリアーキテクチャに対応するSLI/Oの再設計
coconala_engineer
0
190
続・やっぱり余白が大切だった話
kakehashi
PRO
2
160
Dataverseの検索列について
miyakemito
1
170
Running JavaScript within Ruby
hmsk
4
440
OPENLOGI Company Profile
hr01
0
63k
Azure Maps Visual in PowerBIで分析しよう
nakasho
0
190
生成AIのユースケースをとにかく集めてまるっと学ぶ!/ all about generative ai usecases
gakumura
3
360
Dynamic Reteaming And Self Organization
miholovesq
3
740
読んで学ぶ Amplify Gen2 / Amplify と CDK の関係を紐解く #jawsug_tokyo
tacck
PRO
1
300
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
38
1.7k
Site-Speed That Sticks
csswizardry
6
530
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
Writing Fast Ruby
sferik
628
61k
YesSQL, Process and Tooling at Scale
rocio
172
14k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
34
2.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Music & Morning Musume
bryan
47
6.5k
Raft: Consensus for Rubyists
vanstee
137
6.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.4k
Practical Orchestrator
shlominoach
187
11k
Transcript
正式リリースされた Semantic Kernel の Agent Framework 全部紹介! 2025/05/10 (土) 日本マイクロソフト
Cloud Solution Architect & Evangelist 大田 一希
自己紹介 日本マイクロソフト Cloud Solution Architect & Evangelist 大田 一希 (Kazuki
Ota) X: @okazuki https://zenn.dev/okazuki 好き: .NET (20年以上)、Azure PaaS、Azure AI 苦手: インテリセンスの弱い言語 趣味: 技術ブログ書き、お絵描き、ゲーム (最近は原神)
本セッションの目的 Agent を作るのに Semantic Kernel 使ってみようかなって思ってもらう
前提条件 2025年5月10日時点の情報です C#、Python、Java (Preview) に対応していますが 今回は C# で説明を行います Preview 機能も紹介しますが、Preview
機能の本番環境での採用は慎重に
もくじ Semantic Kernel のコア機能 Agent Framework まとめ
Semantic Kernel のコア機能
Semantic Kernel Build intelligent AI agents and multi- agent systems
with this enterprise- ready orchestration framework エンタープライズ対応の インテリジェントな AI エージェント とマルチ エージェント システムを 構築するフレームワーク
Semantic Kernel のコア機能と特徴 モデル非依存の API OpenAI, Azure OpenAI,
Hugging Face, Ollama, etc… プロンプトを扱うための機能 プロンプト テンプレート エンジン (独自, Handlebars, Liquid) YAML 形式のプロンプトの読み込み機能 Plugins による拡張機能 (Function calling) エンタープライズ向けの機能 可観測性、フィルター 安定した API プレビューが外れた API には破壊的変更はほぼ無い 対応プログラミング言語 Python: 3.10+ .NET: 8.0+, .NET Standard 2.0 Java: JDK17+
デモ: Semantic Kernel 1: 純粋なプロンプト呼び出し 2: モデル非依存の Chat Completions API
3: 自動関数呼び出し、フィルターによる Human In The Loop
Semantic Kernel のコア機能 便利に AI を使えるユーテリティ的な立ち位置 • モデル非依存のコードを書ける • プラグインを使って拡張可能
• 便利機能も揃ってる • プロンプト用のテンプレートエンジン • エンタープライズ用途を想定されている • 安定した API 、フィルターなど
Semantic Kernel の高度な機能やプレビュー機能 フレームワーク •エージェント フレームワーク •シングル エージェント •マルチ エージェント機能
(Preview) •プロセス フレームワーク (Preview) その他の機能 •便利な組み込みプラグイン (Preview) •OpenAPI をプラグインとして読み込む •ベクトル検索、ハイブリッド検索の API の抽象化 (Preview) •テキスト検索機能の抽象化 (Preview) •Model Context Protocol サポート (Preview)
Semantic Kernel の高度な機能やプレビュー機能 フレームワーク •エージェント フレームワーク •シングル エージェント •マルチ エージェント機能
(Preview) •プロセス フレームワーク (Preview) その他の機能 •便利な組み込みプラグイン (Preview) •OpenAPI をプラグインとして読み込む •メモリによるベクトル検索、ハイブリッド検索の API の抽象化 (Preview) •テキスト検索機能の抽象化 (Preview) •Model Context Protocol サポート (Preview) 本日のフォーカスエリア
Agent Framework とは
Agent Framework Semantic Kernel のコア機能の上に構築された AI Agent を構築するため のフレームワーク
Agent 抽象化レイヤーを提供 抽象レイヤーに対して様々な実装を提供 ChatCompletionAgent: Chat Completions API を使用した Agent の実装 OpenAIAssistantAgent: Assistant API を使用した Agent の実装 (Preview) AzureAIAgent: Azure AI Agent Service を使用した Agent の実装 (Preview) OpenAIResponsesAgent: OpenAI Responses API を使用した Agent の実装 (Preview) BedrockAgent: AWS の Bedrock を使用した Agent の実装 (Preview) マルチエージェント機能 AgentGroupChat (Preview) Agent の Plugin 化 (Preview)
Agent 抽象化レイヤー エージェントの機能を Agent と AgentThread に抽象化 Agent agent =
...Agentを作る...; const string userInput = "こんにちは!!"; AgentThread? thread = null; await foreach (AgentResponseItem<ChatMessageContent> response in agent.InvokeAsync(userInput, thread)) { thread = response.Thread; Console.WriteLine(response.Message.Content); } if (thread !. null) await thread.DeleteAsync(); const string userInput = "こんにちは!!"; var response = await agent.InvokeAsync(userInput).FirstAsync(); Console.WriteLine(response.Message.Content); 複数の応答に対応したいとき 単発の応答のみの場合
Agent 抽象化レイヤー エージェントの機能を Agent と AgentThread に抽象化 Agent agent =
...Agentを作る...; const string userInput = "こんにちは!!"; AgentThread? thread = null; await foreach (AgentResponseItem<ChatMessageContent> response in agent.InvokeAsync(userInput, thread)) { thread = response.Thread; Console.WriteLine(response.Message.Content); } if (thread !. null) await thread.DeleteAsync(); const string userInput = "こんにちは!!"; var response = await agent.InvokeAsync(userInput).FirstAsync(); Console.WriteLine(response.Message.Content); 複数の応答に対応したいとき 単発の応答のみの場合 会話のスレッド Agent を呼び出す 結果をハンドリング 終わったらスレッドを削除
Agent 抽象化レイヤー エージェントの機能を Agent と AgentThread に抽象化 Agent agent =
...Agentを作る...; const string userInput = "こんにちは!!"; AgentThread? thread = null; await foreach (AgentResponseItem<ChatMessageContent> response in agent.InvokeAsync(userInput, thread)) { thread = response.Thread; Console.WriteLine(response.Message.Content); } if (thread !. null) await thread.DeleteAsync(); const string userInput = "こんにちは!!"; var response = await agent.InvokeAsync(userInput).FirstAsync(); Console.WriteLine(response.Message.Content); 複数の応答に対応したいとき 単発の応答のみの場合 Agent を呼び出して結果を受け取る
Agent 抽象化レイヤー エージェントの機能を Agent と AgentThread に抽象化 Agent agent =
...Agentを作る...; const string userInput = "こんにちは!!"; AgentThread? thread = null; await foreach (AgentResponseItem<ChatMessageContent> response in agent.InvokeAsync(userInput, thread)) { thread = response.Thread; Console.WriteLine(response.Message.Content); } if (thread !. null) await thread.DeleteAsync(); const string userInput = "こんにちは!!"; var response = await agent.InvokeAsync(userInput).FirstAsync(); Console.WriteLine(response.Message.Content); 複数の応答に対応したいとき 単発の応答のみの場合 どの Agent も同じコードで 呼び出し可能
ChatCompletionAgent の作成方法 Agent の名前や指示 (System Prompt) などを設定して作成 Agent agent =
new ChatCompletionAgent { /. Agent 名 Name = "CatAgent", /. Agent への指示 (System Prompt) Instructions = """ あなたは猫型アシスタンスです。猫らしく振舞うために語尾は「にゃん」にしてください。 わからないことに関しては素直にわからないという旨を猫っぽく伝えてください。 """, /. Agent が使用するプラグインなどを含んだ Kernel Kernel = kernel, /. モデルを呼ぶときの細かい設定 Arguments = new(new PromptExecutionSettings() { FunctionChoiceBehavior = FunctionChoiceBehavior.Auto(), }), }; 名前を設定 システムプロンプトを設定 プラグインを含んだ Kernel を設定 関数呼び出しの自動化などの細かい設定
Agent 抽象化レイヤー Semantic Kernel のコア機能の上に構築 Semantic Kernel のコア機能の機能をシームレスに利用可能
プラグイン呼び出し プロンプトのテンプレート エンジン フィルター など…
デモ: シンプルな Agent 1: 猫型エージェント 2: Plugin 機能を使ったエージェント 3: フィルターによる
Human In The Loop 4: Azure AI Agent Service を使った Agent
マルチエージェント機能 (Preview) AgentGroupChat 複数の Agent が参加するグループチャットを作る機能 Agent
のプラグイン化 Agent をプラグインとして別の Agent から呼ぶことが出来るようになる機能
AgentGroupChat 複数の Agent を連携させてタスクをこなすための機能 複数の Agent を追加可能 ChatCompletionAgent,
AzureAIAgent など複数のタイプの Agent を追加可能 AI のオーケストレーション機能 SelectionStrategy 次に、どの Agent が話すべきかを決める TerminationStrategy Agent 同士の会話を終了すべきかどうかを決める エージェントのチャット履歴を減らす機能 Agent の会話履歴が長くなった時に短くするための機能 AgentGroupChat を Agent として扱う機能 AgentGroupChat の入れ子が可能になる
AgentGroupChat のイメージ AgentGroupChat XXXXについて教えてください SelectionStrategy Agent A Agent B Agent
C TerminationStrategy YYYYです! 誰が対応すべきか決める! 会話を終了すべきか決める!
AgentGroupChat この後のデモの内容 Writer agent Reviewer agent XXXについての 記事を書いて 記事 指摘事項
指摘有り 指摘無し 最終稿 この動きを実現するための AgentGroupChat の設定 SelectionStrategy : Agent を順番に実行 (標準提供のクラスを利用) TerminationStrategy : Reviewer agent が OK を出したら終了
デモ: AgentGroupChat Writer と Reviewer による記事作成 Agent
Agent のプラグイン化 Agent をプラグイン化 プラグイン化をした Agent を別の Agent から使うことで
マルチエージェント化が可能 /. プラグインを作成 var plugin = KernelPluginFactory.CreateFromFunctions( "PluginName", /. Agent を関数化 [AgentKernelFunctionFactory.CreateFromAgent(agent)]); /. プラグインをカーネルに追加 kernel.Plugins.Add(plugin); Agent を関数化 関数をプラグイン化
Agent のプラグイン化を使用した場合のイメージ Orchestrator agent Reviewer agent Writer agent 指摘がゼロになるま でライターに記事を
書かせる Agent XXXについての 記事を書いて Writer plugin Reviewer plugin 記事書いて レビュー指摘反映して レビューして 最終稿
GA テクノロジーだけでマルチエージェントするには? 現時点では Agent 同士のオーケストレーションは手組が必要 1. Agent を複数呼び分けるコードを自分で書く 2. Agent
をラップしたプラグインを自作
GA テクノロジーでマルチエージェントするには? Agent の実行基板 1. 短時間で終わるような処理 • Azure App Service
• Container Apps • AKS • Azure Functions 2. 耐久性が欲しかったり実行時間が長い場合にも対応したい場合 1. Container Apps (ジョブ機能) 2. AKS 3. Azure Functions の Durable Functions (個人的な推し)
バックエンド フロントエンド この後のデモの内容 Reviewer agent Writer agent Durable Functions AI
オーケストレーター レビュー指摘が 無くなるまで 執筆依頼をする 依頼 進捗確認 結果取得 レビュー依頼 執筆依頼
デモ: Durable Functions を使用したマルチエージェント Writer と Reviewer による記事作成 Agent
まとめ
今日説明した Semantic Kernel の機能 Semantic Kernel 各種LLM LLM の 抽象化
各種外部 リソース MCP サーバー Agent の 抽象化 Agent系 サービス Agentの 実装 AI対応 アプリ Kernel サービス フィルター プラグイン LLMごとの 実装 マルチ Agent機能
まとめ Semantic Kernel 基本機能 プラグイン、フィルター、モデル非依存、など Agent Framework
Semantic Kernel の基本機能の上に構築された Agent 開発のための機能 マルチエージェント系はまだプレビュー… (本番では手組が必要です) AI を使ったアプリをホストするためのサービス Azure Functions の Durable Functions (個人的な推し) Container Apps Azure App Service AKS
まとめ Semantic Kernel 基本機能 プラグイン、フィルター、モデル非依存、など Agent Framework
Semantic Kernel の基本機能の上に構築された Agent 開発のための機能 マルチエージェント系はまだプレビュー… (本番では手組が必要です) AI を使ったアプリをホストするためのサービス Azure Functions の Durable Functions (個人的な推し) Container Apps Azure App Service AKS Semantic Kernel を使って Agent 対応アプリを開発してみてください
参考資料 Semantic Kernel のドキュメント https://learn.microsoft.com/ja-jp/semantic-kernel/overview/ Semantic Kernel
の GitHub リポジトリ リポジトリトップ: https://github.com/microsoft/semantic-kernel サンプル(C#) : https://github.com/microsoft/semantic-kernel/tree/main/dotnet/samples サンプル(Python) : https://github.com/microsoft/semantic-kernel/tree/main/python/samples サンプル(Java) : https://github.com/microsoft/semantic-kernel-java/tree/main/samples デモで使用したコード https://github.com/runceel/GlobalAzure2025 サンプルめっちゃ有用
© Copyright Microsoft Corporation. All rights reserved.