Skip to content

Latest commit

 

History

History
81 lines (45 loc) · 4.79 KB

File metadata and controls

81 lines (45 loc) · 4.79 KB

Semantic Kernel

Introduction

The Azure Semantic Kernel is an open-source SDK that facilitates the integration of large language models (LLMs) with programming languages like C#, Python, and JavaScript. Utilized by Microsoft for AI application development, including Co-Pilots, this SDK is designed for modularity and extensibility, featuring core concepts like Plugins, Memory, Planner, and Connections.

Concept Overview A visual representation of the Semantic Kernel's core concepts.

Plugins extend SDK functionality; Memory serves as a context store; the Planner generates goal-oriented plans; and Connections interface with external data sources and services.

For more details, visit the Semantic Kernel documentation.

Core Concepts

Before diving into the core concepts, it's essential to understand that the Semantic Kernel is structured to enhance AI application development through these foundational elements.

Plugin / Functions

Plugins in Semantic Kernel encapsulate functions that applications can use. These include semantic functions—defined inline or via files—and native functions. They streamline tasks where LLMs are advantageous, offering a unified interface for function calls.

Plugins The structure of Plugins in the Semantic Kernel.

Sample Plugins

  • Semantic Function Inline: Learn to define and execute a semantic function directly within your code.
  • Semantic Function File: Discover how to create semantic functions in a file and integrate them with the Semantic Kernel.
  • Native Function: See how to incorporate a native C# function within the Semantic Kernel framework.

Plugin Documentation

Memory

Semantic Kernel's Memory abstracts the embedding model and vector databases, simplifying context management for AI applications. It's agnostic to the underlying LLM or Vector DB, offering a uniform developer experience.

Memory An overview of Memory in Semantic Kernel.

Memory Examples

  • Using Memory: A practical example of storing and retrieving information using Semantic Kernel's Memory.

Memory Documentation

Planner

The Planner is a novel feature of the Semantic Kernel that devises execution strategies from user requests. It dynamically orchestrates Plugins to fulfill complex tasks with AI-assisted planning.

Planner Illustration of how the Planner operates within the Semantic Kernel.

Planner Examples

Planner Documentation

RAG

Semantic Kernel makes it easy for developers to implement a RAG (Retrieval Augmented Generation) pattern by providing an abstraction layer to OpenAI models and Vector Databases.

RAG

Steps to implement a RAG pattern:

  1. Create Semantic Kernel instance
  2. Create Semantic Text Memory and Semantic Memory Service
  3. Ingest Data which is used to ground user queries into Semantic Text Memory
  4. Retrieve grounding information form Semantic Text Memory based on user query
  5. Complete user query (user query & retrieved grounding information) by calling ChatCompletion endpoint

RAG Example