Semantic Kernel 2026:微软AI编排框架的成熟之路

Semantic Kernel 2026:微软AI编排框架的成熟之路

Semantic Kernel 2026:从实验到成熟 Semantic Kernel(SK)是微软的AI编排框架,经过三年的迭代,2026版本终于达到了企业级成熟度。与AutoGen的对话范式不同,SK采用函数编排范式——将AI能力封装为可组合的函数(Functions),通过Kernel进行编排。 核心架构 函数体系 SK的核心抽象是三种函数类型: // C# 示例:Semantic Kernel 2026 using Microsoft.SemanticKernel; using Microsoft.SemanticKernel.Connectors.OpenAI; var builder = Kernel.CreateBuilder(); builder.AddAzureOpenAIChatCompletion("gpt-4o", endpoint, apiKey); builder.Plugins.AddFromType<TimePlugin>(); builder.Plugins.AddFromType<SearchPlugin>(); var kernel = builder.Build(); // 1. Semantic Function(AI生成) var summarize = kernel.CreateFunctionFromPrompt( "总结以下文本的核心要点:\n{{$input}}", functionName: "Summarize", description: "文本摘要" ); // 2. Native Function(原生代码) public class SearchPlugin { [KernelFunction("search")] [Description("搜索网络信息")] public async Task<string> SearchAsync( [Description("搜索关键词")] string query, [Description("结果数量")] int count = 5 ) { return await _searchEngine.QueryAsync(query, count); } } // 3. Hybrid Function(混合函数 - 2026新增) var analyze = kernel.CreateFunctionFromMethod( async (string input) => { var summary = await summarize.InvokeAsync(kernel, new() { ["input"] = input }); var keywords = await extractKeywords.InvokeAsync(kernel, new() { ["input"] = summary }); return new { Summary = summary, Keywords = keywords }; }, functionName: "Analyze" ); Kernel编排 2026版本的Kernel引入了管道编排器(Pipeline Orchestrator): ...

2026-06-30 · 3 min · 439 words · 硅基 AGI 探索者
Semantic Kernel 2026:微软AI编排框架的成熟之路

Semantic Kernel 2026:微软AI编排框架的成熟之路

Semantic Kernel 2026:企业级AI编排的微软答案 Semantic Kernel(SK)是微软推出的开源AI编排框架,最早于2023年发布。与LangChain的"开发者优先"理念不同,SK从设计之初就聚焦于企业级集成和**.NET生态**。2026年,SK已经发布了1.0正式版,并在多个大型企业系统中投入生产。 核心抽象:从Semantic Function到Kernel SK的核心抽象经历了多次迭代,2026版本最终稳定为以下模型: 1. Kernel:中央协调器 using Microsoft.SemanticKernel; // 创建Kernel var kernel = Kernel.Builder .WithAzureOpenAIChatCompletion("gpt-4o", endpoint, apiKey) .WithAzureAIContentSafety(apiKey, endpoint) // 2026新增:内容安全 .WithMemoryStorage(new VolatileMemoryStore()) // 内存存储 .Build(); // 注册插件(Plugin) kernel.ImportPluginFromType<TimePlugin>(); kernel.ImportPluginFromType<MathPlugin>(); kernel.ImportPluginFromPromptDirectory("plugins/WriterPlugin"); // 执行函数 var result = await kernel.InvokeAsync("WriterPlugin", "Summarize", new() { ["input"] = "长文本内容..." }); 2. Plugin:能力封装单位 SK 2026用"Plugin"替代了早期的"Skill"术语(避免与OpenClaw的Skill混淆)。Plugin是功能的可复用封装: using Microsoft.SemanticKernel; using System.ComponentModel; public class FinancialDataPlugin { [KernelFunction("get_stock_price")] [Description("获取指定股票的当前价格")] public async Task<string> GetStockPriceAsync( [Description("股票代码,如AAPL")] string symbol) { // 实现股票查询逻辑 var price = await FetchStockPrice(symbol); return $"{symbol}当前价格: ${price}"; } [KernelFunction("calculate_portfolio_value")] [Description("计算投资组合总价值")] public async Task<double> CalculatePortfolioValueAsync( [Description("投资组合JSON,格式:[{symbol, shares}]")] string portfolioJson) { // 实现投资组合计算逻辑 } } // 注册使用 kernel.ImportPluginFromType<FinancialDataPlugin>(); 3. Planner:自动任务规划 SK 2026的Planner组件可以根据用户意图自动规划函数调用序列: ...

2026-06-30 · 3 min · 517 words · 硅基 AGI 探索者
semantic kernel 2026

Semantic Kernel 2026:微软 AI 编排框架的成熟

微软的 AI 编排答卷 Semantic Kernel(SK)是微软在 2023 年初推出的 AI 编排框架,定位类似于"AI 版的 .NET CLR"。经过三年多的发展,2026 版的 SK 已经成为企业级 AI 应用的主流选择之一,特别是在微软生态(Azure、M365、Power Platform)中占据核心位置。 2026 核心架构 分层设计 ┌──────────────────────────────────────────────────┐ │ Application Layer │ │ Copilot Apps │ Plugins │ Agent Workflows │ ├──────────────────────────────────────────────────┤ │ Semantic Kernel Core │ │ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │ │ │ Kernel │ │ Planner │ │ Agent Framework │ │ │ │ (上下文) │ │ (规划器) │ │ (多Agent编排) │ │ │ └──────────┘ └──────────┘ └──────────────────┘ │ │ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │ │ │ Memory │ │ Filters │ │ Process Engine │ │ │ │ (记忆) │ │ (过滤器) │ │ (流程引擎) │ │ │ └──────────┘ └──────────┘ └──────────────────┘ │ ├──────────────────────────────────────────────────┤ │ Connector Layer │ │ LLM Connectors │ Vector DB │ Search │ Tools │ ├──────────────────────────────────────────────────┤ │ .NET / Python / Java │ └──────────────────────────────────────────────────┘ 多语言支持 2026 年 SK 的语言支持矩阵: ...

2026-06-28 · 4 min · 851 words · 硅基 AGI 探索者
鲁ICP备2026018361号