# microsoft/semantic-kernel architecture

> Architecture diagram of the GitHub repository microsoft/semantic-kernel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoft/semantic-kernel
- Repository: https://github.com/microsoft/semantic-kernel

## Overview

Semantic Kernel is a model-agnostic SDK for building AI agents and multi-agent workflows. In the documented basic flow, a user prompt enters an agent configured with a model service; the agent returns a response. Plugins extend agents with callable tools, while orchestration coordinates specialist agents. The repository tree also shows runtime messaging, provider connectors, embeddings, and OpenAPI tooling. Several branches are documented capabilities rather than inspected call paths, so those relationships are cited to the README; unsampled implementation details are represented only at supported paths.

Main entry points: [`dotnet/src/Agents/Core/ChatCompletionAgent.cs`](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Core/ChatCompletionAgent.cs) (Chat agent), [`dotnet/src/Agents/Orchestration/AgentOrchestration.cs`](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Orchestration/AgentOrchestration.cs) (Agent orchestration), [`dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunction.cs`](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunction.cs) (Kernel functions), [`dotnet/src/Plugins/Plugins.Web/WebSearchEnginePlugin.cs`](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Plugins/Plugins.Web/WebSearchEnginePlugin.cs) (Web search plugin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Agents"]
  node_agent_api["Agent API<br/>[Agent.cs]"]
  node_chat_agent["Chat agent"]
  node_agent_adapters["Provider agents"]
  node_agent_state["Chat history<br/>[ChatHistory.cs]"]
end

subgraph group_orchestration["Orchestration"]
  node_orchestration["Agent orchestration"]
  node_multiagent_modes["Workflow modes"]
  node_group_chat["Group chat<br/>[AgentGroupChat.cs]"]
  node_magentic["Magentic teams"]
end

subgraph group_kernel["Kernel and plugins"]
  node_kernel["Kernel<br/>[Kernel.cs]"]
  node_functions["Kernel functions<br/>[KernelFunction.cs]"]
  node_openapi["OpenAPI tools<br/>[openapi_manager.py]"]
  node_web_search["Web search plugin"]
  node_chat_content["Chat content"]
end

subgraph group_models["Model integrations"]
  node_service_selection["Service selection"]
  node_azure_chat["Azure inference"]
  node_onnx_embeddings["ONNX embeddings"]
end

subgraph group_runtime["Runtime and embeddings"]
  node_runtime_core["Agent runtime<br/>[AgentsApp.cs]"]
  node_inprocess["In-process messaging"]
  node_embedding_api["Embedding API"]
  node_vector_stores[("Vector stores<br/>[astra_client.py]")]
end

node_user(("User"))
node_external_model{{"Model providers"}}
node_external_tool{{"External tools"}}

node_user -->|"prompts"| node_chat_agent
node_chat_agent -->|"uses kernel"| node_kernel
node_chat_agent -->|"invokes service"| node_azure_chat
node_azure_chat -.->|"requests completion"| node_external_model
node_chat_agent -.->|"maintains conversation"| node_agent_state
node_chat_agent -->|"calls tools"| node_functions
node_functions -.->|"exposes plugin"| node_web_search
node_functions -.->|"exposes operations"| node_openapi
node_web_search -.->|"searches"| node_external_tool
node_orchestration -.->|"supports workflows"| node_multiagent_modes
node_orchestration -.->|"coordinates agents"| node_group_chat
node_orchestration -.->|"runs teams"| node_magentic
node_chat_agent -.->|"implements"| node_agent_api
node_agent_adapters -.->|"adapts providers"| node_agent_api
node_runtime_core -.->|"dispatches messages"| node_inprocess
node_embedding_api -.->|"implemented by"| node_onnx_embeddings
node_onnx_embeddings -.->|"supplies vectors"| node_vector_stores

click node_agent_api "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Abstractions/Agent.cs"
click node_chat_agent "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Core/ChatCompletionAgent.cs"
click node_agent_adapters "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/OpenAI/OpenAIResponseAgent.cs"
click node_agent_state "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatHistory.cs"
click node_orchestration "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Orchestration/AgentOrchestration.cs"
click node_multiagent_modes "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Orchestration/Concurrent/ConcurrentOrchestration.cs"
click node_group_chat "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Core/AgentGroupChat.cs"
click node_magentic "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Magentic/MagenticOrchestration.cs"
click node_kernel "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/Kernel.cs"
click node_functions "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunction.cs"
click node_openapi "https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/connectors/openapi_plugin/openapi_manager.py"
click node_web_search "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Plugins/Plugins.Web/WebSearchEnginePlugin.cs"
click node_chat_content "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/Contents/ChatMessageContent.cs"
click node_service_selection "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/Services/AIServiceExtensions.cs"
click node_azure_chat "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Connectors/Connectors.AzureAIInference/Services/AzureAIInferenceChatCompletionService.cs"
click node_onnx_embeddings "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Connectors/Connectors.Onnx/BertOnnxTextEmbeddingGenerationService.cs"
click node_runtime_core "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Runtime/Core/AgentsApp.cs"
click node_inprocess "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Runtime/InProcess/InProcessRuntime.cs"
click node_embedding_api "https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/AI/Embeddings/ITextEmbeddingGenerationService.cs"
click node_vector_stores "https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/connectors/memory_stores/astradb/astra_client.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_agent_api,node_chat_agent,node_agent_adapters,node_agent_state,node_user toneBlue
class node_orchestration,node_multiagent_modes,node_group_chat,node_magentic toneAmber
class node_kernel,node_functions,node_openapi,node_web_search,node_chat_content toneMint
class node_service_selection,node_azure_chat,node_onnx_embeddings toneRose
class node_runtime_core,node_inprocess,node_embedding_api,node_vector_stores,node_external_model,node_external_tool toneIndigo
```

## Components

### Agents

- [Agent API](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Abstractions/Agent.cs): `dotnet/src/Agents/Abstractions/Agent.cs`
- [Chat agent](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Core/ChatCompletionAgent.cs): `dotnet/src/Agents/Core/ChatCompletionAgent.cs`
- [Provider agents](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/OpenAI/OpenAIResponseAgent.cs): `dotnet/src/Agents/OpenAI/OpenAIResponseAgent.cs`
- [Chat history](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatHistory.cs): `dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatHistory.cs`

### Orchestration

- [Agent orchestration](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Orchestration/AgentOrchestration.cs): `dotnet/src/Agents/Orchestration/AgentOrchestration.cs`
- [Workflow modes](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Orchestration/Concurrent/ConcurrentOrchestration.cs): `dotnet/src/Agents/Orchestration/Concurrent/ConcurrentOrchestration.cs`
- [Group chat](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Core/AgentGroupChat.cs): `dotnet/src/Agents/Core/AgentGroupChat.cs`
- [Magentic teams](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Magentic/MagenticOrchestration.cs): `dotnet/src/Agents/Magentic/MagenticOrchestration.cs`

### Kernel and plugins

- [Kernel](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/Kernel.cs): `dotnet/src/SemanticKernel.Abstractions/Kernel.cs`
- [Kernel functions](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunction.cs): `dotnet/src/SemanticKernel.Abstractions/Functions/KernelFunction.cs`
- [OpenAPI tools](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/connectors/openapi_plugin/openapi_manager.py): `python/semantic_kernel/connectors/openapi_plugin/openapi_manager.py`
- [Web search plugin](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Plugins/Plugins.Web/WebSearchEnginePlugin.cs): `dotnet/src/Plugins/Plugins.Web/WebSearchEnginePlugin.cs`
- [Chat content](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/Contents/ChatMessageContent.cs): `dotnet/src/SemanticKernel.Abstractions/Contents/ChatMessageContent.cs`

### Model integrations

- [Service selection](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/Services/AIServiceExtensions.cs): `dotnet/src/SemanticKernel.Abstractions/Services/AIServiceExtensions.cs`
- [Azure inference](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Connectors/Connectors.AzureAIInference/Services/AzureAIInferenceChatCompletionService.cs): `dotnet/src/Connectors/Connectors.AzureAIInference/Services/AzureAIInferenceChatCompletionService.cs`
- [ONNX embeddings](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Connectors/Connectors.Onnx/BertOnnxTextEmbeddingGenerationService.cs): `dotnet/src/Connectors/Connectors.Onnx/BertOnnxTextEmbeddingGenerationService.cs`

### Runtime and embeddings

- [Agent runtime](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Runtime/Core/AgentsApp.cs): `dotnet/src/Agents/Runtime/Core/AgentsApp.cs`
- [In-process messaging](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Agents/Runtime/InProcess/InProcessRuntime.cs): `dotnet/src/Agents/Runtime/InProcess/InProcessRuntime.cs`
- [Embedding API](https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/AI/Embeddings/ITextEmbeddingGenerationService.cs): `dotnet/src/SemanticKernel.Abstractions/AI/Embeddings/ITextEmbeddingGenerationService.cs`
- [Vector stores](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/connectors/memory_stores/astradb/astra_client.py): `python/semantic_kernel/connectors/memory_stores/astradb/astra_client.py`

### Other components

- **User**
- **Model providers**
- **External tools**

## Connections

- User → Chat agent: prompts
- Chat agent → Kernel: uses kernel
- Chat agent → Azure inference: invokes service
- Azure inference → Model providers: requests completion
- Chat agent → Chat history: maintains conversation
- Chat agent → Kernel functions: calls tools
- Kernel functions → Web search plugin: exposes plugin (evidence: `dotnet/src/Plugins/Plugins.Web/WebSearchEnginePlugin.cs`)
- Kernel functions → OpenAPI tools: exposes operations
- Web search plugin → External tools: searches
- Agent orchestration → Workflow modes: supports workflows
- Agent orchestration → Group chat: coordinates agents
- Agent orchestration → Magentic teams: runs teams
- Chat agent → Agent API: implements
- Provider agents → Agent API: adapts providers
- Agent runtime → In-process messaging: dispatches messages
- Embedding API → ONNX embeddings: implemented by (evidence: `dotnet/src/Connectors/Connectors.Onnx/BertOnnxTextEmbeddingGenerationService.cs`)
- ONNX embeddings → Vector stores: supplies vectors
