Registry / llm-agents / semantic-kernel

semantic-kernel

JSON →
library1.44.1pypypi✓ verified 26d ago

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
INSTALL
IMPORT
SIG · SEMANTIC-KERNEL
S
semantic-kernel
llm-agentspythonv1.44.1
Install
19.0s avg
Import
7534ms
Disk
659MB
Pass rate
9/ 10
Env Coverage9 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.44.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 30.23s
py 3.11
✓ 0.03s
✓ 30.48s
py 3.12
✓ 0.03s
✓ 26.53s
py 3.13
✓ —
✓ 26.53s
py 3.9
✓ —
3/4 runs
659MB installed
● package 659MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Kernel
from semantic_kernel import Kernel
from semantic_kernel.kernel import Kernel
Import directly from the package root.
AzureChatCompletion
from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion
from semantic_kernel.connectors.ai.azure import AzureChatCompletion
Azure OpenAI connector lives under the openai module, not a separate azure module.
kernel_function decorator
from semantic_kernel.functions import kernel_function
from semantic_kernel import sk_function
sk_function was the old decorator name (pre-1.0). Removed. Use @kernel_function.
SemanticTextMemory (DEPRECATED)
from semantic_kernel.data.vector import VectorStoreField, vectorstoremodel
from semantic_kernel.memory import SemanticTextMemory
SemanticTextMemory and MemoryStoreBase are deprecated. Migrate to VectorStore/VectorStoreCollection.
KernelArguments
from semantic_kernel.functions import KernelArguments
from semantic_kernel.orchestration import SKContext
SKContext was removed in 1.0. Use KernelArguments.

Basic chat completion with OpenAI

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())
Debug
Known issues
breakingAzure 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=...)
affects: pre-1.x code upgrading to 1.x
breakingSemanticTextMemory 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
affects: any code using SemanticTextMemory, IMemoryStore, or the old memory connectors
breakingGoogle 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.
affects: any code using semantic-kernel[google] before 1.39.0
breakingTemplate 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.
affects: 1.x
breakingsk_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.
affects: pre-1.0 code
breakingSKContext removed. Replaced by KernelArguments. Any code importing or using SKContext will fail.
fix
Replace SKContext with KernelArguments from semantic_kernel.functions.
affects: pre-1.0 code
gotchaazure-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
affects: 1.10.0+
gotchaMicrosoft 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
affects: all
gotchaPydantic 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.
affects: all 1.x
breakingOpenAIChatCompletion 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.
affects: all 1.x
Upgrade
Version history
1.44.1latest on PyPI · released Aug 6, 2026
Audit
Dependencies
Python >=3.10requiredHard requirement.
pydantic >=2requiredPydantic v2 required. Pydantic v1 not supported.
azure-identityoptionalRequired for AzureChatCompletion with Entra ID / managed identity auth. NOT included in base install — must use semantic-kernel[azure] or install separately.
Agent activity
74 hits · last 30 days
node
62
OpenAI (training)
1
Resources
semantic-kernel — pip install semantic-kernel · libregistry