Semantic Kernel SDK

repository·main·Indexed 12 days ago

https://github.com/microsoft/semantic-kernel

A model-agnostic SDK for building, orchestrating, and deploying AI agents and multi-agent systems. It supports connecting to various LLMs, managing plugins, and handling complex workflows via C# (.NET 6+) and Python. Note: Semantic Kernel is being succeeded by the Microsoft Agent Framework (MAF) for enterprise-ready multi-agent orchestration.

Tokens
236K
Snippets
530
Records
873
Agent score
98%

What's inside Semantic Kernel

  1. Overview of OpenAI Realtime API with Semantic Kernel

    main
    This sample demonstrates how to integrate the OpenAI Realtime API with Semantic Kernel. While RealtimeConversationClient from the Azure/OpenAI SDK is recommended for standard conversational experiences, this specific implementation focuses on leveraging the Realtime API's support for function calling by combining it with Semantic Kernel plugins and functions.
  2. Overview of Process With Cloud Events Demos

    main

    These demos demonstrate how to use the Semantic Kernel (SK) Process Framework to emit and receive Cloud Events. The solution is split into three main components:

    • ProcessWithCloudEvents.Processes: Contains the core Process Builder definitions, steps, models, and structures. This project is independent of the runtime.
    • ProcessWithCloudEvents.Grpc: A gRPC server utilizing DAPR that interacts with the processes defined in the Processes project via gRPC.
    • ProcessWithCloudEvents.Client: A ReactJS application used to showcase the sending and receiving of Cloud Events to and from a running SK Process on a server.
  3. Overview of Process Framework with SignalR Demo

    main

    This demo illustrates how to use the Semantic Kernel (SK) Process Framework to emit and receive cloud events using SignalR. It consists of three main components:

    • ProcessFrameworkWithSignalR.ProcessOrchestrator: Contains the Process Builder definitions, steps, models, and structures (runtime-independent).
    • ProcessFrameworkWithSignalR.AppHost: Contains the .NET Aspire orchestration for the environment.
    • ProcessFrameworkWithSignalR.ReactFrontend: A ReactJS application used to showcase sending and receiving cloud events to and from a running SK Process.
  4. What is Microsoft Semantic Kernel?

    main
    Microsoft Semantic Kernel is an open-source development kit (middleware) designed to integrate AI models into applications written in C#, Python, or Java. It enables developers to build AI agents, automate business processes, and connect application code with AI technologies. It accepts inputs like text or structured commands and produces outputs such as natural language, function calls, and actionable data.
  5. Overview of Copilot Agent Plugins (CAPs) Sample

    main

    The CopilotAgentPluginDemoSample is a .NET console application designed to demonstrate how to create and use hand-rolled plugins for Generative AI experiences in Microsoft 365. These plugins leverage Microsoft Graph APIs to perform CRUD operations, allowing Semantic Kernel to use AutoInvokeFunctions to interact with Microsoft 365 data (Contacts, Messages, Calendar, and DriveItems) via natural language prompts.

    Key capabilities include:

    • LLM Integration: Supports Azure OpenAI, OpenAI, or local hosting via Ollama.
    • Delegated Authentication: Demonstrates how to run actions on behalf of a user using Microsoft Identity platform authentication.
    • Reasoning: Shows how the agent can reason over Microsoft 365 data to synthesize responses or execute actions.
  6. Overview of Model Context Protocol (MCP) integration

    main

    This sample demonstrates how to integrate Model Context Protocol (MCP) tools into Semantic Kernel. MCP is an open protocol that standardizes how applications provide context to Large Language Models (LLMs).

    The integration workflow involves:

    1. Connecting to an MCP Server using the ModelContextProtocol NuGet package.
    2. Retrieving the list of tools available from the MCP Server.
    3. Converting those MCP tools into Semantic Kernel functions.
    4. Adding the converted functions to a Kernel instance to enable tool invocation via function calling.
  7. Overview of Semantic Kernel concepts by feature

    main

    The Concepts directory contains code snippets demonstrating various Semantic Kernel features. Key areas of exploration include:

    • Agents: Different implementation patterns for using Agents.
    • AudioToText: Using IAudioToTextService to extract text from audio.
    • FunctionCalling: Demonstrating function calling capabilities with compatible models.
    • Caching: Various implementations of caching strategies.
    • ChatCompletion: Using IChatCompletionService for messaging-capable models.
    • DependencyInjection: Using the DI Container within Semantic Kernel.
    • Filtering: Different ways to apply filters to the kernel pipeline.
    • Functions: Invoking Method functions (via KernelFunctionFromMethod) or Prompt functions (via KernelFunctionFromPrompt) using the Kernel.
    • ImageToText: Using IImageToTextService to describe images.
  8. Bedrock Connector Capabilities and Limitations

    main

    The Semantic Kernel Bedrock connector's support depends on the underlying AWS model capabilities:

    Modalities

    • Supported: Text, Image, and Embedding.
    • Unsupported: Image embeddings and Text-to-Image.

    Features

    • Text vs Chat: Support varies by model (Text completion, Chat/Converse API, or both).
    • Tool Use: Depends on the specific model.
    • Streaming: Depends on the specific model.
    • Guardrails: Currently unsupported.

    Always verify model-specific support (Region, Streaming, Tool Use) via the AWS documentation.

  9. Explore Semantic Kernel Python Concepts by Feature

    main

    This documentation provides a comprehensive collection of Python samples demonstrating core Semantic Kernel capabilities. Key areas of focus include:

    • Agents: Implementing various agent types including Azure AI Agent, Bedrock Agent, Chat Completion Agent, OpenAI Assistant Agent, and Mixed Agent Group Chat.
    • Auto Function Calling: Enabling models to automatically invoke Kernel Functions.
    • Chat Completion & History: Using ChatCompletion services and managing conversation state with ChatHistory (including serialization).
    • Memory & RAG: Implementing vector-based memory and Retrieval-Augmented Generation (RAG) patterns.
    • Plugins: Creating and using Plugins from directories, custom code, or existing services.
    • Processes: Using the Process Framework for complex workflows like nested processes or plan-and-execute patterns.
    • Prompt Templates: Using parameterized templates with languages like Jinja2 or Handlebars.
    • Local Models: Connecting to local LLM providers like Ollama, LM Studio, and OnnxGenAI.
  10. Explore Migration Sample Categories

    main

    Migration samples are organized by integration type and orchestration pattern:

    CategoryDescription
    AzureAIFoundryAzure OpenAI service integration samples
    AzureOpenAIDirect Azure OpenAI API integration samples
    AzureOpenAIAssistantsAzure OpenAI Assistants API integration samples
    AzureOpenAIResponsesAzure OpenAI Responses API integration samples
    OpenAIDirect OpenAI API integration samples
    OpenAIAssistantsOpenAI Assistants API integration samples
    OpenAIResponsesOpenAI Responses API integration samples
    AgentOrchestrationsOrchestration patterns (concurrent, sequential, and handoff workflows)
  11. Extend Copilot Studio with a Semantic Kernel Skill

    main
    This template demonstrates how to build a Copilot Studio Skill using a pro-code approach. It uses Semantic Kernel to power a custom API hosted in Azure Container Apps, which is then exposed to Microsoft Copilot Studio via the Azure Bot Service. This allows you to extend agent capabilities with complex logic or enterprise data that requires more than low-code automation.
  12. Explore Semantic Kernel Python Samples

    main

    The python/samples directory contains various tutorials and demonstrations for using Semantic Kernel in Python. You can navigate through the following categories to learn specific features:

    • Getting Started: Step-by-step tutorials for the core Kernel, Agents, and Processes.
    • Concepts: Focused samples illustrating specific Semantic Kernel abstractions.
    • Demos: Comprehensive samples demonstrating the integration of multiple Semantic Kernel features.
    • Learn Resources: Code snippets corresponding to official Microsoft Learn and DevBlog documentation.