0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

semantic kernel入門

Posted at

① Semantic Kernel 入門

―― エンタープライズ AI エージェント開発の青写真

Semantic Kernel 入門

エンタープライズ AI エージェント開発の青写真
Published 2025-05-07

TL;DR

  • Semantic Kernel (SK) は Microsoft 製のオープンソース SDK。Planner/Memory/Function Calling を軸に 「業務プロセス ⇄ LLM」 を橋渡しする。
  • 強み : 拡張性・プラグイン経済・エンタープライズ指向のロードマップ。
  • 典型用途 : FAQ Bot→社内ドキュメント検索→自律タスク実行と段階的に拡張できる。

1. なぜ今 Semantic Kernel なのか

  • エンタープライズ要求(監査ログ/セキュリティ/冪等性)が盛り込まれた設計。
  • プラグインは OpenAI Functions 相当 のインターフェース。C#・Python・Java に同一 API。:contentReference[oaicite:2]{index=2}

2. コアコンポーネントざっくり図解

コンポーネント ひとこと説明 主な役割
Kernel DI コンテナのようなハブ モデル設定・メモリ設定を一元管理
Semantic Function =prompt + schema GPT 呼び出しを型安全に
Planner ゴール駆動のタスク分解 “LLM に計画させる”
Memory key-value or vector 過去対話・外部文書を検索
接続先 SQL / Blob / Qdrant など Memory Connector で差し替え可能

3. 5 分で動かす:Planner + Memory

# 1) pip install semantic-kernel openai
from semantic_kernel import Kernel, MemoryStore
from semantic_kernel.planning import BasicPlanner

kernel = Kernel()
kernel.add_text_completion_service("gpt", "gpt-4o", api_key="YOUR_KEY")

# Memory: 社内手順書を登録
kernel.memory = MemoryStore.from_texts(
    texts=["手順1: ...", "手順2: ..."], namespace="ops-doc"
)

planner = BasicPlanner(kernel)
goal = "今週の運用タスクをリストアップしてください"

plan = planner.create_plan(goal)
print("## PLAN\n", plan.generated_plan)
result = planner.execute_plan(plan)
print("## RESULT\n", result)

🔍 ポイント

  • MemoryStore は後で Redis / Azure AI Search へ差し替え可
  • generated_plan をログに残せば監査証跡になる

4. 企業導入パターン

🥉 ★★★ Phase 1 ― FAQ Bot

社内規程 PDF ➜ Embedding ➜ Memory ➜ QA

🥈 ★★★★ Phase 2 ― Smart RAG

Planner で「なぜそう答えたか」を根拠リンク付きで生成

🥇 ★★★★★ Phase 3 ― 自律エージェント

Planner + 外部 API Plugin(JIRA, ServiceNow)で半自動チケット解決


5. ロードマップと今後

  • Small Model Support: 社内 GPU 上で LLama 3 を走らせる公式レシピ予定([Microsoft for Developers][1])
  • マルチエージェント協調 API: “複数 Planner をオーケストレーション” 機能を開発中

まとめ

Semantic Kernel は 「LLM を業務フローに埋め込む標準ライブラリ」 を目指す。
Planner × Memory が動けば、次は ログ設計権限管理 を考えよう!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?