{"id":71,"library":"semantic-kernel","title":"Semantic Kernel","description":"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).","status":"active","version":"1.39.4","language":"python","source_language":"en","source_url":"https://pypi.org/project/semantic-kernel/","tags":["agents","orchestration","microsoft","azure","openai","rag","plugins","vector-store","python","production-stable"],"install":[{"cmd":"pip install --upgrade semantic-kernel","lang":"bash","label":"Minimal install (OpenAI/Azure OpenAI)"},{"cmd":"pip install --upgrade semantic-kernel[azure]","lang":"bash","label":"With Azure extras (azure-identity, azure-ai-inference, azure-search-documents)"},{"cmd":"pip install --upgrade semantic-kernel[google]","lang":"bash","label":"With Google Gemini connector"},{"cmd":"pip install --upgrade semantic-kernel[all]","lang":"bash","label":"All connectors and extras"}],"dependencies":[{"reason":"Hard requirement.","package":"Python >=3.10","optional":false},{"reason":"Pydantic v2 required. Pydantic v1 not supported.","package":"pydantic >=2","optional":false},{"reason":"Required for AzureChatCompletion with Entra ID / managed identity auth. NOT included in base install — must use semantic-kernel[azure] or install separately.","package":"azure-identity","optional":true}],"imports":[{"note":"Import directly from the package root.","wrong":"from semantic_kernel.kernel import Kernel","symbol":"Kernel","correct":"from semantic_kernel import Kernel"},{"note":"Azure OpenAI connector lives under the openai module, not a separate azure module.","wrong":"from semantic_kernel.connectors.ai.azure import AzureChatCompletion","symbol":"AzureChatCompletion","correct":"from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion"},{"note":"sk_function was the old decorator name (pre-1.0). Removed. Use @kernel_function.","wrong":"from semantic_kernel import sk_function","symbol":"kernel_function decorator","correct":"from semantic_kernel.functions import kernel_function"},{"note":"SemanticTextMemory and MemoryStoreBase are deprecated. Migrate to VectorStore/VectorStoreCollection.","wrong":"from semantic_kernel.memory import SemanticTextMemory","symbol":"SemanticTextMemory (DEPRECATED)","correct":"from semantic_kernel.data.vector import VectorStoreField, vectorstoremodel"},{"note":"SKContext was removed in 1.0. Use KernelArguments.","wrong":"from semantic_kernel.orchestration import SKContext","symbol":"KernelArguments","correct":"from semantic_kernel.functions import KernelArguments"}],"quickstart":{"code":"import asyncio\nfrom semantic_kernel import Kernel\nfrom semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion\nfrom semantic_kernel.connectors.ai.open_ai import OpenAIChatPromptExecutionSettings\nfrom semantic_kernel.contents import ChatHistory\n\nasync def main():\n    kernel = Kernel()\n    kernel.add_service(OpenAIChatCompletion(ai_model_id=\"gpt-4o\"))\n\n    history = ChatHistory(system_message=\"You are a helpful assistant.\")\n    history.add_user_message(\"Hello, what can you do?\")\n\n    service = kernel.get_service(type=OpenAIChatCompletion)\n    settings = OpenAIChatPromptExecutionSettings()\n    response = await service.get_chat_message_content(chat_history=history, settings=settings, kernel=kernel)\n    print(response.content)\n\nasyncio.run(main())","lang":"python","description":"Basic chat completion with OpenAI"},"warnings":[{"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=...)","message":"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.","severity":"breaking","affected_versions":"pre-1.x code upgrading to 1.x"},{"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","message":"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.","severity":"breaking","affected_versions":"any code using SemanticTextMemory, IMemoryStore, or the old memory connectors"},{"fix":"Upgrade to 1.39.0+. Uninstall google-generativeai if no longer needed. Install semantic-kernel[google] which now pulls in google-genai.","message":"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.","severity":"breaking","affected_versions":"any code using semantic-kernel[google] before 1.39.0"},{"fix":"Serialize complex types to strings before passing as template arguments, or disable automatic encoding.","message":"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.","severity":"breaking","affected_versions":"1.x"},{"fix":"Replace @sk_function with @kernel_function from semantic_kernel.functions.","message":"sk_function decorator removed. The old @sk_function decorator from pre-1.0 is gone. All plugin methods must use @kernel_function.","severity":"breaking","affected_versions":"pre-1.0 code"},{"fix":"Replace SKContext with KernelArguments from semantic_kernel.functions.","message":"SKContext removed. Replaced by KernelArguments. Any code importing or using SKContext will fail.","severity":"breaking","affected_versions":"pre-1.0 code"},{"fix":"pip install semantic-kernel[azure] or pip install azure-identity","message":"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.","severity":"gotcha","affected_versions":"1.10.0+"},{"fix":"For new agentic projects, evaluate Microsoft Agent Framework. Existing SK code is stable and supported. Migration guide: https://aka.ms/autogen-to-af","message":"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.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to Pydantic v2. Check for other dependencies pinning Pydantic v1.","message":"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.","severity":"gotcha","affected_versions":"all 1.x"},{"fix":"Provide the OpenAI API key explicitly to OpenAIChatCompletion (e.g., api_key='...') or ensure the OPENAI_API_KEY environment variable is set.","message":"OpenAIChatCompletion requires an API key. Attempting to initialize OpenAIChatCompletion without an explicitly provided API key (or environment variable) will result in a ServiceInitializationError.","severity":"breaking","affected_versions":"all 1.x"}],"env_vars":null,"last_verified":"2026-05-12T06:51:59.181Z","next_check":"2026-05-28T00:00:00.000Z","problems":[{"fix":"Replace calls like `await kernel.run_async(plugin[function])` with `await kernel.invoke(plugin[function])` or `await kernel.invoke_prompt(...)`.","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.","error":"AttributeError: 'Kernel' object has no attribute 'run_async'"},{"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`.","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.","error":"ModuleNotFoundError: No module named 'semantic_kernel.orchestration'"},{"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()`.","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.","error":"AttributeError: 'Kernel' object has no attribute 'add_chat_service'"},{"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\"))`.","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.","error":"openai.AuthenticationError: No API key provided."}],"ecosystem":"pypi","meta_description":null,"install_score":75,"install_tag":"reviewed","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"reviewed","tag_description":"minor failures on some runtimes or slightly older test data","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.62,"mem_mb":43.5,"disk_size":"457.8M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.51,"mem_mb":43.5,"disk_size":"457.8M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"azure","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.49,"mem_mb":43.4,"disk_size":"468.2M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"google","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.53,"mem_mb":43.3,"disk_size":"648.4M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.28,"mem_mb":43.5,"disk_size":"454M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.34,"mem_mb":43.5,"disk_size":"454M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"azure","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.29,"mem_mb":43.4,"disk_size":"465M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"google","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.25,"mem_mb":43.3,"disk_size":"639M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.43,"mem_mb":44.5,"disk_size":"486.9M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.42,"mem_mb":44.5,"disk_size":"486.9M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"azure","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.45,"mem_mb":44.6,"disk_size":"498.9M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"google","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.6,"mem_mb":44.3,"disk_size":"702.3M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.57,"mem_mb":44.5,"disk_size":"482M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.61,"mem_mb":44.5,"disk_size":"482M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"azure","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.75,"mem_mb":44.6,"disk_size":"494M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"google","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.64,"mem_mb":44.3,"disk_size":"692M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.41,"mem_mb":44.2,"disk_size":"469.7M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.42,"mem_mb":44.2,"disk_size":"469.7M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"azure","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.44,"mem_mb":44.2,"disk_size":"481.4M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"google","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.5,"mem_mb":44.2,"disk_size":"681.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.86,"mem_mb":44.2,"disk_size":"465M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.83,"mem_mb":44.2,"disk_size":"465M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"azure","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.75,"mem_mb":44.2,"disk_size":"477M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"google","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.5,"mem_mb":44.2,"disk_size":"672M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.83,"mem_mb":46.9,"disk_size":"467.7M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.97,"mem_mb":46.9,"disk_size":"467.7M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"azure","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.95,"mem_mb":46.9,"disk_size":"479.2M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"google","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":5.91,"mem_mb":46.9,"disk_size":"677.4M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.16,"mem_mb":46.9,"disk_size":"463M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.17,"mem_mb":46.9,"disk_size":"463M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"azure","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.08,"mem_mb":46.9,"disk_size":"474M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"google","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":6.29,"mem_mb":46.9,"disk_size":"667M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"all","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"azure","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"google","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"all","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"azure","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"google","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}