Semantic Kernel
raw JSON → 1.39.4 verified Tue May 12 auth: no python install: reviewed quickstart: stale
Microsoft's open-source SDK for integrating LLMs into applications. Model-agnostic (OpenAI, Azure OpenAI, Google, Hugging Face, Mistral, etc.), supports Python, C#, and Java. Provides plugins (tools), prompt templating, multi-agent orchestration (AgentChat framework), and vector store integrations for RAG. Production-stable as of v1.x. Currently the primary Microsoft-maintained AI framework (AutoGen is maintenance-only; Microsoft Agent Framework is the future successor).
pip install --upgrade semantic-kernel Common errors
error AttributeError: 'Kernel' object has no attribute 'run_async' ↓
cause The `run_async` method used in semantic-kernel v0.x was deprecated and replaced by `invoke` (or `invoke_prompt`, `invoke_plugin_async`) in v1.x.
fix
Replace calls like
await kernel.run_async(plugin[function]) with await kernel.invoke(plugin[function]) or await kernel.invoke_prompt(...). error ModuleNotFoundError: No module named 'semantic_kernel.orchestration' ↓
cause The module structure for semantic-kernel underwent significant changes in v1.x, leading to various modules and classes (like `orchestration` and `Planner`) being refactored or moved.
fix
Update imports to reflect the v1.x structure; for example,
FunctionCallingStepwisePlanner is now found in from semantic_kernel.planners.function_calling_stepwise_planner.function_calling_stepwise_planner import FunctionCallingStepwisePlanner. error AttributeError: 'Kernel' object has no attribute 'add_chat_service' ↓
cause In semantic-kernel v1.x, AI service registration moved from direct methods on the `Kernel` instance to methods on the `KernelBuilder` or `kernel.add_service()` for a pre-initialized kernel.
fix
Initialize the kernel using a builder pattern for service registration:
kernel = sk.KernelBuilder().add_openai_chat_service(service_id="chat_gpt", model_id="gpt-4", api_key=os.getenv("OPENAI_API_KEY")).build(). error openai.AuthenticationError: No API key provided. ↓
cause The OpenAI API key is either missing, incorrect, or not accessible via environment variables or direct configuration when initializing the OpenAI service within semantic-kernel.
fix
Ensure the
OPENAI_API_KEY environment variable is set, or explicitly pass the API key during service configuration: kernel.add_service(OpenAIChatService(service_id="my_chat", model_id="gpt-4", api_key="YOUR_API_KEY")). Warnings
breaking Azure Identity fallback authentication removed. In older versions, AzureChatCompletion would silently fall back to azure-identity DefaultAzureCredential if no api_key was provided. This implicit fallback has been removed. Code relying on it will now raise errors on import or at runtime. ↓
fix Install azure-identity explicitly (pip install azure-identity or pip install semantic-kernel[azure]) and pass credentials explicitly: AzureChatCompletion(ad_token_provider=...) or AzureChatCompletion(api_key=...)
breaking SemanticTextMemory and MemoryStoreBase are deprecated and will be removed. The entire old memory store architecture (semantic_kernel.memory, semantic_kernel.connectors.memory_stores) has been superseded by the new VectorStore API. ↓
fix Migrate to semantic_kernel.data.vector: use @vectorstoremodel, VectorStoreField, and connector-specific VectorStore classes (e.g., from semantic_kernel.connectors.memory import ChromaCollection). See: https://learn.microsoft.com/en-us/semantic-kernel/support/migration/vectorstore-python-june-2025
breaking Google connector migrated from google-generativeai SDK to the new google-genai SDK (v1.39.0, Feb 2026). If using the Google connector, the underlying dependency has changed. ↓
fix Upgrade to 1.39.0+. Uninstall google-generativeai if no longer needed. Install semantic-kernel[google] which now pulls in google-genai.
breaking Template argument encoding now throws on complex types. Previously, complex types (custom classes, anonymous types, collections) passed as prompt template arguments were silently not encoded. Now an exception is raised if automatic encoding is enabled (the default) and a complex type is passed. ↓
fix Serialize complex types to strings before passing as template arguments, or disable automatic encoding.
breaking sk_function decorator removed. The old @sk_function decorator from pre-1.0 is gone. All plugin methods must use @kernel_function. ↓
fix Replace @sk_function with @kernel_function from semantic_kernel.functions.
breaking SKContext removed. Replaced by KernelArguments. Any code importing or using SKContext will fail. ↓
fix Replace SKContext with KernelArguments from semantic_kernel.functions.
gotcha azure-identity is NOT included in the base pip install semantic-kernel. Importing AzureChatCompletion (which requires Entra ID support) will fail with ImportError if azure-identity is not installed separately. ↓
fix pip install semantic-kernel[azure] or pip install azure-identity
gotcha Microsoft Agent Framework (successor to both AutoGen and Semantic Kernel) has reached Release Candidate status (Feb 2026). Semantic Kernel remains actively maintained but Microsoft is directing new agentic projects toward Agent Framework. ↓
fix For new agentic projects, evaluate Microsoft Agent Framework. Existing SK code is stable and supported. Migration guide: https://aka.ms/autogen-to-af
gotcha Pydantic v1 is not supported. semantic-kernel requires Pydantic v2. If your project pins Pydantic v1 (e.g., via an older FastAPI or LangChain version), there will be a dependency conflict. ↓
fix Upgrade to Pydantic v2. Check for other dependencies pinning Pydantic v1.
breaking OpenAIChatCompletion requires an API key. Attempting to initialize OpenAIChatCompletion without an explicitly provided API key (or environment variable) will result in a ServiceInitializationError. ↓
fix Provide the OpenAI API key explicitly to OpenAIChatCompletion (e.g., api_key='...') or ensure the OPENAI_API_KEY environment variable is set.
Install
pip install --upgrade semantic-kernel[azure] pip install --upgrade semantic-kernel[google] pip install --upgrade semantic-kernel[all] Install compatibility reviewed last tested: 2026-05-12
python os / libc status wheel install import disk
3.10 alpine (musl) - - 5.62s 457.8M
3.10 alpine (musl) - - 5.51s 457.8M
3.10 alpine (musl) - - 5.49s 468.2M
3.10 alpine (musl) - - 5.53s 648.4M
3.10 slim (glibc) - - 4.28s 454M
3.10 slim (glibc) - - 4.34s 454M
3.10 slim (glibc) - - 4.29s 465M
3.10 slim (glibc) - - 4.25s 639M
3.11 alpine (musl) - - 6.43s 486.9M
3.11 alpine (musl) - - 6.42s 486.9M
3.11 alpine (musl) - - 6.45s 498.9M
3.11 alpine (musl) - - 6.60s 702.3M
3.11 slim (glibc) - - 5.57s 482M
3.11 slim (glibc) - - 6.61s 482M
3.11 slim (glibc) - - 5.75s 494M
3.11 slim (glibc) - - 5.64s 692M
3.12 alpine (musl) - - 6.41s 469.7M
3.12 alpine (musl) - - 6.42s 469.7M
3.12 alpine (musl) - - 6.44s 481.4M
3.12 alpine (musl) - - 6.50s 681.8M
3.12 slim (glibc) - - 6.86s 465M
3.12 slim (glibc) - - 6.83s 465M
3.12 slim (glibc) - - 6.75s 477M
3.12 slim (glibc) - - 6.50s 672M
3.13 alpine (musl) - - 5.83s 467.7M
3.13 alpine (musl) - - 5.97s 467.7M
3.13 alpine (musl) - - 5.95s 479.2M
3.13 alpine (musl) - - 5.91s 677.4M
3.13 slim (glibc) - - 6.16s 463M
3.13 slim (glibc) - - 6.17s 463M
3.13 slim (glibc) - - 6.08s 474M
3.13 slim (glibc) - - 6.29s 667M
3.9 alpine (musl) - - - -
3.9 alpine (musl) - - - -
3.9 alpine (musl) - - - -
3.9 alpine (musl) - - - -
3.9 slim (glibc) - - - -
3.9 slim (glibc) - - - -
3.9 slim (glibc) - - - -
3.9 slim (glibc) - - - -
Imports
- Kernel wrong
from semantic_kernel.kernel import Kernelcorrectfrom semantic_kernel import Kernel - AzureChatCompletion wrong
from semantic_kernel.connectors.ai.azure import AzureChatCompletioncorrectfrom semantic_kernel.connectors.ai.open_ai import AzureChatCompletion - kernel_function decorator wrong
from semantic_kernel import sk_functioncorrectfrom semantic_kernel.functions import kernel_function - SemanticTextMemory (DEPRECATED) wrong
from semantic_kernel.memory import SemanticTextMemorycorrectfrom semantic_kernel.data.vector import VectorStoreField, vectorstoremodel - KernelArguments wrong
from semantic_kernel.orchestration import SKContextcorrectfrom semantic_kernel.functions import KernelArguments
Quickstart stale last tested: 2026-05-12
import asyncio
from semantic_kernel import Kernel
from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion
from semantic_kernel.connectors.ai.open_ai import OpenAIChatPromptExecutionSettings
from semantic_kernel.contents import ChatHistory
async def main():
kernel = Kernel()
kernel.add_service(OpenAIChatCompletion(ai_model_id="gpt-4o"))
history = ChatHistory(system_message="You are a helpful assistant.")
history.add_user_message("Hello, what can you do?")
service = kernel.get_service(type=OpenAIChatCompletion)
settings = OpenAIChatPromptExecutionSettings()
response = await service.get_chat_message_content(chat_history=history, settings=settings, kernel=kernel)
print(response.content)
asyncio.run(main())