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
1
2.2k
正式リリースされた 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
260
Semantic Kernel の Agent 機能試してみた!
okazuki
1
800
.NET Aspire を始めよう
okazuki
0
400
空のプロジェクトから始める Blazor
okazuki
1
530
.NET Aspire を使おう!
okazuki
0
320
Semantic Kernel を使って ChatGPT Plugins をアプリに組み込んでみよう
okazuki
1
870
Other Decks in Technology
See All in Technology
20250514_未経験から Fintech実務参画まで。学生エンジニアの挑戦録
hideto1008
0
900
New Cache Hierarchy for Container Images and OCI Artifacts in Kubernetes Clusters using Containerd / KubeCon + CloudNativeCon Japan
pfn
PRO
0
130
AI とペアプロしてわかった 3 つのヒューマンエラー
takahiroikegawa
1
600
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.2k
Amazon DevOps Guru のベースラインを整備して1ヶ月ほど運用してみた #jawsug_asa / Amazon DevOps Guru trial
masahirokawahara
3
230
(新URLに移行しました)FASTと向き合うことで見えた、大規模アジャイルの難しさと楽しさ
wooootack
0
480
Web Intelligence and Visual Media Analytics
weblyzard
PRO
1
6.1k
ハッカー視点で学ぶサイバー攻撃と防御の基本
nomizone
0
870
Go Connectへの想い
chiroruxx
0
160
ai bot got sick (abc 2025s version)
kojira
0
160
会社紹介資料 / Sansan Company Profile
sansan33
PRO
6
370k
データ戦略部門 紹介資料
sansan33
PRO
1
3.2k
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Cult of Friendly URLs
andyhume
79
6.4k
Site-Speed That Sticks
csswizardry
10
620
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Making Projects Easy
brettharned
116
6.2k
Facilitating Awesome Meetings
lara
54
6.4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
Side Projects
sachag
454
42k
A Tale of Four Properties
chriscoyier
159
23k
How STYLIGHT went responsive
nonsquared
100
5.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Music & Morning Musume
bryan
46
6.6k
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.