====== Semantic Kernel ====== **Semantic Kernel** (SK) is a lightweight, open-source SDK from [[microsoft|Microsoft]] for building AI agents and integrating language models into enterprise applications. Available for **C#**, **Python**, and **Java**, it serves as the AI orchestration layer within the broader Microsoft Agent Framework. The Agent Framework reached general availability (GA) as version 1.0 by the end of Q1 2025.((([[https://github.com/microsoft/semantic-kernel|Semantic Kernel GitHub Repository.]])) Semantic Kernel is used by [[microsoft|Microsoft]] and Fortune 500 companies for building production-grade AI applications with [[modular|modular]], secure, and observable architectures.((([[https://learn.microsoft.com/en-us/semantic-kernel/|Semantic Kernel Documentation.]])) ===== Core Concepts ===== **The Kernel** is the central dependency injection container that manages all services, plugins, and components. It selects optimal AI services, builds prompts from templates, invokes models, and parses responses — all configurable from a single place. **Plugins** extend LLM capabilities with business logic, productivity workflows, and external function calls. Plugins are [[modular|modular]] and reusable across different AI applications. **Planners** enable the Kernel to automatically decompose complex goals into sequences of plugin calls. The Agent Framework extends this with event-driven task management and human approval workflows. **Connectors** integrate with various AI models ([[openai|OpenAI]], Azure OpenAI, [[deepseek|DeepSeek]]) and external services. Expanded connector support in 2025 includes the OpenAI Realtime Audio API. ===== Architecture ===== The Kernel acts as a central orchestrator with a layered design: * **AI Service Layer** — Connectors to LLM providers ([[openai|OpenAI]], Azure, local models) * **Plugin Layer** — Business logic, tools, and external integrations * **Prompt Layer** — Template management and [[prompt_engineering|prompt engineering]] * **Planning Layer** — Goal decomposition and task orchestration * **Memory Layer** — Context-aware agent memory and retrieval * **Observability Layer** — Telemetry, hooks, and filters for responsible AI This agent-centric design extends RAG workflows to [[multi_agent_systems|multi-agent systems]] using unified declarative formats. ===== Multi-Language Support ===== Semantic Kernel provides full 1.0+ support across three languages: * **C# / .NET** — Primary implementation, deeply integrated with Azure * **Python** — Full feature parity for Python-first teams * **Java** — Enterprise Java support for JVM-based applications ===== Code Example ===== import semantic_kernel as sk from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion from semantic_kernel.functions import kernel_function # Create the kernel kernel = sk.Kernel() # Add an AI service kernel.add_service( OpenAIChatCompletion(service_id="chat", ai_model_id="gpt-4o") ) # Define a plugin with kernel functions class MathPlugin: @kernel_function(description='Add two numbers') def add(self, a: float, b: float) -> float: return a + b @kernel_function(description='Multiply two numbers') def multiply(self, a: float, b: float) -> float: return a * b # Import the plugin kernel.add_plugin(MathPlugin(), plugin_name='Math') # Invoke a function result = await kernel.invoke( kernel.plugins['Math']['add'], a=15.0, b=27.0 ) print(result) # 42.0 ===== Integration with AutoGen ===== Semantic Kernel and [[autogen|AutoGen/AG2]] converge through three integration paths defined in the 2025 roadmap: - [[autogen|AutoGen]] agents can leverage Semantic Kernel capabilities directly - [[autogen|AutoGen]] agents can be hosted within the SK ecosystem for seamless migration - Harmonized runtimes enable multi-agent interoperability This unified approach supports deployment through Azure AI Foundry Agent Service, with paths from local prototyping to cloud-scale production. ===== See Also ===== * [[vercel_ai_sdk|Vercel AI SDK]] * [[ai_coding_assistants|AI Coding Assistants]] * [[ai_agents|AI Agents]] * [[anthropic_messages|Anthropic Messages API]] * [[openrouter_owl_alpha|OpenRouter Owl Alpha]] ===== References ===== * [[https://github.com/[[microsoft|microsoft]]/semantic-kernel|Semantic Kernel GitHub Repository]] * [[https://learn.[[microsoft|microsoft]].com/en-us/semantic-kernel/|Semantic Kernel Documentation]] * [[https://devblogs.microsoft.com/agent-framework/semantic-kernel-roadmap-h1-2025-accelerating-agents-processes-and-integration/|SK Roadmap H1 2025]](([[https://devblogs.microsoft.com/agent-framework/semantic-kernel-roadmap-h1-2025-accelerating-agents-processes-and-integration/|Semantic Kernel Roadmap H1 2025: Accelerating Agents, Processes, and Integration]])) * [[https://devblogs.microsoft.com/agent-framework/|Microsoft Agent Framework Blog]](([[https://devblogs.microsoft.com/agent-framework/|Microsoft Agent Framework Developer Blog]]))