Semantic Kernel
Type: full-code · Vendor: Microsoft · Language: .NET, Python, Java · License: MIT · Status: maintenance · Status in practice: mature · First released: 2023-02-27 · Successor: microsoft-agent-framework
Lightweight model-agnostic SDK (C#/Python/Java) that turns existing code into Plugins of KernelFunctions so LLMs can call them via auto function calling, with first-class observability, MCP/OpenAPI extensibility, and an Agent Framework for single/multi-agent orchestration.
Description. Semantic Kernel is Microsoft's open-source middleware that wraps any chat-completion model behind a Kernel and exposes user code as KernelFunctions grouped into Plugins. The framework drives an auto function-calling loop (FunctionChoiceBehavior.Auto()) that serialises plugin schemas as JSON, lets the model emit function calls, marshals arguments, invokes the function, and feeds results back — repeating until the model returns a chat reply. Plugins import natively or from OpenAPI specs or MCP Servers (MCPStdioPlugin, MCPSsePlugin, MCPStreamableHttpPlugin). The Agent Framework adds ChatCompletionAgent, OpenAIAssistantAgent, AzureAIAgent, and OpenAIResponsesAgent plus an orchestration package. OpenTelemetry-compatible logs/metrics/spans emit as Microsoft.SemanticKernel activities. Now succeeded by Microsoft Agent Framework 1.0; SK itself remains stable with v1.x releases continuing through late 2025.
Agent loop shape. Kernel sits between chat-completion service and user code. With FunctionChoiceBehavior.Auto() set, SK serialises all registered plugin functions to JSON schema, sends them with chat history, parses any tool_calls the model returns, marshals JSON into the function's typed parameters, invokes the function (optionally with DI), appends a FunctionCallContent/FunctionResultContent pair to the chat history, and re-prompts the model — looping until the model returns a chat message or a max-iteration cap is reached. Agent Framework instantiates ChatCompletionAgent / OpenAIAssistantAgent / AzureAIAgent / OpenAIResponsesAgent over this same kernel + plugin substrate.
Primary use cases
- .NET / Python / Java enterprise apps adding LLM tool calling
- Plugin-based extension of LLMs with native code, OpenAPI, or MCP
- Multi-agent orchestration via Agent Framework
- OpenTelemetry-instrumented LLM apps in regulated environments
Key concepts
- Kernel (docs) — Middleware container coordinating chat services + plugins.
- Plugin → skill-library (docs) — Group of KernelFunctions exposed to the LLM as callable tools.
- Auto function calling → tool-use (docs) — FunctionChoiceBehavior.Auto() drives the JSON-schema tool-call loop.
- Agent Framework (docs) — ChatCompletionAgent / OpenAIAssistantAgent / AzureAIAgent over the kernel.
- MCP plugins → mcp (docs) — MCPStdioPlugin, MCPSsePlugin, MCPStreamableHttpPlugin import MCP-server tools as plugins.
- OpenTelemetry observability (docs) — Spans + metrics + logs emitted under Microsoft.SemanticKernel namespace.
Patterns this full-code implements —
- ★★Model Context Protocol
Multiple MCP plugin types (stdio, SSE, Streamable HTTP); MCP is a first-class plugin importer.
- ★Skill Library
Plugins are the canonical skill library — three import paths (native, OpenAPI, MCP).
- ★★Tool Use
Auto function calling is the framework's defining loop.
- ★★Agent Resumption
Per-turn ChatHistory can be serialised by the caller; no built-in checkpoint/resume API like LangGraph's Checkpointer.
- ★★ReAct
SK does not name ReAct; tool loop is auto function calling. Thought/action/observation pattern is emergent rather than a named module.
- ★★Structured Output
Function parameters are JSON-schema-typed and return types can be Pydantic/typed classes, but no top-level response_model API at the Kernel level.
- ★★Supervisor
Agents.Orchestration package provides multi-agent collaboration; no first-class supervisor abstraction.
Neighbourhood
Click any neighbour to follow the lineage. Scroll to zoom, drag to pan.