# Semantic Kernel

> Microsoft's model-agnostic SDK for building AI agents and multi-agent systems

- Category: Agents & Automation / Agent Frameworks & Builders
- Language: Python, C#, Java
- Licence: MIT
- Repository: https://github.com/microsoft/semantic-kernel
- Website: https://learn.microsoft.com/semantic-kernel/
- Canonical page: https://ai-tldr.dev/tools/semantic-kernel/

## In short

Semantic Kernel is Microsoft's open-source SDK for building AI agents and multi-agent systems. It sits in the Agent Frameworks & Builders category of the Agents & Automation tools and is open-source, written in Python, C#, Java and licensed MIT. To get started: set your API key.

## Overview

Semantic Kernel is Microsoft's open-source SDK for building AI agents and multi-agent systems. It is model-agnostic, so you can connect it to OpenAI, Azure OpenAI, Hugging Face, NVIDIA, and local runtimes like Ollama, LM Studio, or ONNX. The same core concepts are available across Python, .NET, and Java.

It targets developers who want to add agents, tool-calling plugins, memory, and planning to their applications with stable APIs and enterprise concerns like observability and security in mind. You can start with a single chat assistant and grow into workflows where several specialist agents collaborate.

Note: the project's README states Semantic Kernel's successor is the Microsoft Agent Framework, which Microsoft positions as the production-ready path forward. Semantic Kernel remains usable, but new projects should check the official migration guide before committing.

## What it does

- Model-agnostic: connect to OpenAI, Azure OpenAI, Hugging Face, NVIDIA, and others
- Agent framework for building agents with tools/plugins, memory, and planning
- Multi-agent orchestration for workflows with collaborating specialist agents
- Plugins from native code functions, prompt templates, OpenAPI specs, or MCP
- Vector DB integrations including Azure AI Search, Elasticsearch, and Chroma
- Local model deployment via Ollama, LM Studio, or ONNX; multimodal text, vision, and audio

## Getting started

Set your AI service API key, install the SDK for your language, then create a basic chat agent. The examples below use Azure OpenAI.

1. Set your API key

   Export the environment variable for your AI service before running your app.

```bash
export AZURE_OPENAI_API_KEY=AAA....
# or, for OpenAI directly:
export OPENAI_API_KEY=sk-...
```

2. Install the SDK

   Install the Python package with pip. For .NET, add the Microsoft.SemanticKernel packages instead.

```bash
pip install semantic-kernel
```

3. Create a basic agent (Python)

   Initialize a ChatCompletionAgent with instructions and get a response to a prompt.

```python
import asyncio
from semantic_kernel.agents import ChatCompletionAgent
from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion

async def main():
    agent = ChatCompletionAgent(
        service=AzureChatCompletion(),
        name="SK-Assistant",
        instructions="You are a helpful assistant.",
    )
    response = await agent.get_response(messages="Write a haiku about Semantic Kernel.")
    print(response.content)

asyncio.run(main())
```

4. .NET alternative

   On .NET, add the packages with the dotnet CLI, then build a Kernel and a ChatCompletionAgent.

```bash
dotnet add package Microsoft.SemanticKernel
dotnet add package Microsoft.SemanticKernel.Agents.Core
```

## When to use it

- Add a chat assistant with tool-calling plugins to an existing .NET, Python, or Java app
- Orchestrate multiple specialist agents that collaborate on a multi-step workflow
- Build a RAG-style assistant backed by a vector DB like Azure AI Search, Elasticsearch, or Chroma
- Prototype agents against local models via Ollama or LM Studio without sending data to a cloud API
