$ show microsoft/semantic-kernel
Microsoft Semantic Kernel is an AI orchestration SDK for building multi-agent systems, process workflows, and LLM-powered applications. It provides a unified abstraction layer over multiple AI providers (OpenAI, Azure, Google, Mistral, Ollama, HuggingFace, etc.) and supports function calling, plugin systems, prompt templates, memory/vector stores, and content safety filters. The framework is implemented in both Python and .NET with consistent architectural patterns. In production, the system acts as a library that developers embed into their applications. The central Kernel class manages service registration, plugin loading, and function execution. Agents (ChatCompletionAgent, AzureAIAgent, etc.) provide conversational interfaces with tool-calling capabilities. The process framework enables event-driven, multi-step workflows with state persistence. The filter system allows cross-cutting concerns like logging, moderation, and quality checks to be injected into function invocation and prompt rendering pipelines. Key entry points include the Kernel class, agent classes, ProcessBuilder for workflows, and various sample scripts. Data flows typically involve user input being processed by an agent or kernel, which invokes AI services via connectors, optionally calls plugins/functions, and returns responses. The framework relies on external AI services, vector databases, and optionally Dapr for distributed process execution. While primarily an application framework, Semantic Kernel includes data/research-oriented components such as vector store integrations, embedding generation services, and quality evaluation filters, making it a hybrid tool suitable for both production AI applications and experimental research.
The LLM identified 4 files worth highlighting for reuse:
Provides a clean interceptor pattern for injecting custom logic before and after function invocation. Allows developers to add logging, moderation, quality checks, or error handling without modifying core function logic. The filter chain is extensible and composable, making it a reusable pattern for any AI application.
Encapsulates the algorithm for selecting which agent speaks next in a multi-agent group chat. The strategy pattern allows different selection behaviors (sequential, round-robin, AI-managed) to be swapped without changing the group chat infrastructure. This is a clean implementation of the Strategy design pattern applied to agent coordination.
Base class for defining stateful, event-driven workflow steps. Each step can declare kernel functions that are executed when the step is activated, and can emit events to trigger subsequent steps. The pattern supports complex process orchestration with branching, parallelism, and state persistence, all while keeping step definitions isolated and testable.
Abstract base class for managing conversation history length. Implementations can truncate by token count, message count, or custom logic. This pattern is essential for keeping LLM context windows within limits while preserving relevant conversation context. The abstraction allows different reduction strategies to be swapped easily.