Semantic Kernel
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.
Solution
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
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.