Semantic Kernel — Microsoft AI Agent Framework
Semantic Kernel is Microsoft enterprise AI agent framework for Python, .NET, and Java. 27.6K+ GitHub stars. Multi-model, multi-agent, vector DB integration. MIT.
Agent 可直接安装
这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。
npx -y tokrepo@latest install afa12811-f346-4e42-8dbe-10b87d1cb51a --target codex先 dry-run 确认安装计划,再运行此命令。
What it is
Semantic Kernel is Microsoft's open-source AI agent framework that provides a lightweight SDK for integrating LLMs into Python, .NET, and Java applications. It uses a plugin architecture where AI capabilities (called 'skills') are composed with traditional code functions. Semantic Kernel supports multiple AI models, multi-agent orchestration, and vector database integration.
Semantic Kernel is for enterprise developers building AI-powered applications on the Microsoft stack, as well as teams that need a framework supporting multiple programming languages and model providers.
The project is actively maintained with regular releases and a growing user community. Documentation covers common use cases, and the open-source nature means you can inspect the source code, contribute fixes, and adapt the tool to your specific requirements.
How it saves time or tokens
Semantic Kernel abstracts the differences between OpenAI, Azure OpenAI, Hugging Face, and other model providers behind a unified interface. You write your agent logic once and swap models without code changes. The planner component automatically breaks complex tasks into steps, reducing the prompt engineering needed to orchestrate multi-step workflows.
How to use
- Install the Semantic Kernel SDK for your language (pip, NuGet, or Maven).
- Configure a kernel instance with your AI model provider and API keys.
- Register plugins (functions) and invoke them through the kernel's planner or direct function calling.
Example
import semantic_kernel as sk
from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion
kernel = sk.Kernel()
kernel.add_service(OpenAIChatCompletion(
service_id='chat',
ai_model_id='gpt-4',
api_key='your-key'
))
# Define a semantic function
summarize = kernel.add_function(
plugin_name='text',
function_name='summarize',
prompt='Summarize this text in 2 sentences: {{$input}}'
)
result = await kernel.invoke(summarize, input='Long document text here...')
print(result)
Related on TokRepo
- AI Tools for Agents -- Agent frameworks and orchestration tools
- Multi-Agent Frameworks -- Compare multi-agent approaches
Common pitfalls
- The Python and .NET SDKs have different API surfaces. Code examples from one language do not translate directly to another.
- The automatic planner can produce unexpected step sequences. For production use, define explicit function chains instead of relying on the planner for critical workflows.
- Vector store connectors require separate packages. The base SDK does not include database drivers for Pinecone, Weaviate, or Qdrant.
Before adopting this tool, evaluate whether it fits your team's existing workflow. Read the official documentation thoroughly, and start with a small proof-of-concept rather than a full migration. Community forums, GitHub issues, and Stack Overflow are valuable resources when you encounter edge cases not covered in the documentation.
常见问题
Semantic Kernel provides SDKs for Python, .NET (C#), and Java. The Python and .NET versions are the most mature, with Java support being newer. All three share the same plugin architecture and concepts.
Semantic Kernel is designed for enterprise environments with strong .NET support and Microsoft ecosystem integration. LangChain is Python-first with a larger community plugin ecosystem. Semantic Kernel uses a plugin/skill model; LangChain uses chains and tools.
Yes. Semantic Kernel has first-class support for Azure OpenAI Service. You can configure Azure-specific endpoints, deployments, and API versions directly in the kernel configuration.
A plugin is a collection of functions that the kernel can invoke. Functions can be semantic (LLM-powered with a prompt template) or native (regular code). Plugins are the primary unit of composition in Semantic Kernel.
Yes. Semantic Kernel is used in production at Microsoft and by enterprise customers. It is MIT-licensed, actively maintained, and follows semantic versioning for API stability.
引用来源 (3)
- Semantic Kernel GitHub— Semantic Kernel is Microsoft's AI agent framework
- Semantic Kernel Documentation— Plugin architecture for composing AI and native functions
- Semantic Kernel AI Connectors— Supports OpenAI, Azure OpenAI, and Hugging Face models
来源与感谢
Created by Microsoft. Licensed under MIT. microsoft/semantic-kernel — 27,600+ GitHub stars
讨论
相关资产
Microsoft Agent Framework — Build & Run Agent Workflows
Microsoft Agent Framework builds production-grade agents and multi-agent workflows in Python and .NET, with official docs and quickstarts for teams.
AutoGen — Microsoft Multi-Agent Conversation Framework
Framework by Microsoft Research for building multi-agent conversational AI systems. Agents chat with each other to solve tasks collaboratively. Supports human-in-the-loop and code execution. 40,000+ stars.
Semantic Kernel — AI Orchestration SDK by Microsoft
Build AI agents and integrate LLMs into .NET, Python, and Java apps with Microsoft's open-source AI orchestration framework.
Claude Code Agent: Microsoft Agent Framework Python
Create, update, refactor, explain or work with code using the Python version of Microsoft Agent Framework.