Understanding
Semantic Kernel
SDK
HELLO!
I am Trevoir
Williams
Software Engineer | Lecturer |
Author
2
Course Objectives
▸ Gain a Comprehensive Understanding of the Semantic
Kernel SDK
▹ Explore the core concepts, architecture, and capabilities
of the Semantic Kernel SDK in .NET development
▸ Develop AI-Powered Plugins
▹ Learn to build modular, reusable plugins that enhance
application functionality with AI capabilities.
▸ Integrate AI Models into Applications
▹ Discover how to seamlessly LLMs like Azure OpenAI
Service into your workflows. 3
Course Objectives
▸ Implement Real-World Applications
▹ Build projects such as virtual assistants, career coaches,
or automated decision-making systems using the
Semantic Kernel SDK.
▸ Apply Hands-On Skills Through Labs and Projects
▹ Gain practical experience by working on guided labs and
capstone projects to reinforce learning.
4
Key Features
▸ Introduction to Semantic Kernel SDK
▹ Overview of the Semantic Kernel SDK and in-depth
explanations of its purpose and role in integrating AI into
modern applications.
▸ Hands-On Guided Exercises
▹ Step-by-step tutorials to set up the SDK environment and
practical exercises to build and deploy plugins. Lab tasks
focused on using AI models like Azure OpenAI and GPT.
5
Key Features
▸ Real-World Use Cases
▹ Build a career coaching system that processes user
queries, retrieves historical data, and offers personalized
advice.
▹ Build a web application with a chat agent to assist a user.
▸ Advanced SDK Features
▹ Exploring Memory, Planning, and Reasoning
capabilities. Configuring AI to support long-term memory
for context retention.
6
Pre-requisites
▸ Familiarity with .NET and C# programming, including
foundational concepts such as object-oriented programming,
libraries, and API usage.
▸ Understanding Azure services at a high level is helpful, but
deep Azure experience isn’t required as this will be covered
in context.
▸ Basic understanding of AI and AI concepts and keywords.
▸ Optional – Complete Generative AI for .NET Developers
with Azure AI Services.
7
Welcome
!
Let’s get
Started
8
Introduction to
Semantic Kernel
Section
Overview
▸ What is an LLM?
▸ What is Generative AI?
▸ What is Semantic Kernel?
▸ What are the benefits of the Semantic Kernel?
▸ Overview of AI Agents
▹ How they are used in business
10
What is an LLM?
▸ A large language model (LLM) is an artificial intelligence
model designed to understand and generate human-like
text based on vast data.
▸ Generative AI applications are powered by LLMs, which
allow you to perform natural language processing (NLP)
tasks.
▸ Models such as OpenAI's GPT series and Google's BERT are
prominent LLMs used in various applications.
▸ Utilizes deep learning techniques to perform tasks like
▹ language translation,
▹ summarization,
▹ conversation and sentence completion.
11
What is Generative AI?
▸ Artificial Intelligence (AI) imitates human behavior by using
machine learning to interact with the environment and
execute tasks without explicit directions on what to output.
▸ Generative AI describes a category of capabilities within AI
that create original content.
▸ People typically interact with generative AI through chat
applications like Microsoft Copilot or ChatGPT.
▸ Generative AI applications accept natural language input
(like English) and return appropriate responses in natural
language, images, or code.
12
What is Semantic
Kernel?
▸ An open-source SDK that empowers developers to
build custom AI agents.
▸ Allows developers to combine large language
models (LLMs) with native code and create AI agents
that understand and respond to natural language
prompts.
▸ It is an efficient middleware that enables rapid
delivery of enterprise-grade solutions.
▸ Support across C#, Python, and Java.
13
Source: [Link]
14
Why use Semantic
Kernel?
▸ Semantic Kernel integrates LLMs like OpenAI, Azure
OpenAI, and Hugging Face
▸ Developers can create "plugins" to interface with
the LLMs and perform various tasks.
▸ The Semantic Kernel SDK also provides built-in
plugins that can quickly enhance an application.
▸ Developers can easily utilize LLMs in their own
applications without having to learn the intricacies
the model's API.
16
Why use Semantic
Kernel?
▸ The Semantic Kernel SDK offers a simplified
integration of AI capabilities into existing
applications.
▸ The Semantic Kernel SDK allows developers to
create a streamlined, reliable AI experience,
avoiding the potential unpredictability of prompts
and responses from LLMs used directly.
▸ The SDK supports fine-tuning prompts and planning
tasks to create a controlled and predictable user
experience.
17
AI Agents
▸ An AI agent is a software entity that can make decisions,
take actions, or interact with an environment
autonomously to achieve specific goals.
▸ AI agents use artificial intelligence, including machine
learning and natural language processing, to understand
and respond to their environment, often adapting based on
feedback.
▸ They are designed to achieve specific tasks or goals, such
as recommending products, answering customer queries,
or controlling a robot in a physical space.
18
AI Agent examples
▸ Chatbots and Virtual Assistants: AI agents that interact
with users, answering questions, providing information, or
helping with tasks.
▸ Recommendation Systems: AI agents that suggest
products, movies, or content based on user preferences
and behaviors.
▸ Robotic Process Automation (RPA): AI agents that
handle repetitive tasks like data entry, form processing, or
scheduling.
▸ Robotic AI Agents: Agents that operate in physical
environments, such as warehouse robots, autonomous
vehicles, or home assistants.
19
Understanding AI Agents in
Business Context
▸ AI agents help businesses:
▹ streamline operations,
▹ improve customer service,
▸ They make applications smarter and more
responsive to user needs.
▸ They also enhance decision-making by automating
tasks, providing insights.
20
Section Review
▸ Overview of modern AI technologies
▹ LLMs and Generative AI
▸ Overview of the Sematic Kernel
▹ Benefits and potential
▸ Overview of AI Agents and how they can help business
21
Development
Environment
Setup
Section
Overview
▸ Review Development environment
▸ Visual Studio vs Visual Studio Code
▸ Version Check
▸ Microsoft Azure
23
Visual Studio & .NET
Versions
▸ Flagship IDE [Link] Development
▸ Latest version – 2022
▹ .NET Desktop Development Workload
▹ [Link] and web Development Workload
▹ Azure Development Workload *
▸ .NET 8 LTS
▹ .NET 9 (good option)
24
Visual Studio Code
▸ Great cross-platform alternative
▹ Windows, Linux, and Mac support
▹ .NET is also compatible
▸ C# Dev Kit is a useful extension
▸ Will require some CLI commands
25
Overview of Microsoft
Azure
▸ Microsoft’s flagship cloud computing platform, providing
services like computing, networking, storage, and databases.
▸ It offers seamless hybrid cloud solutions, allowing businesses
to integrate on-premises data centers with cloud resources.
▸ Provides easy scalability, allowing businesses to quickly scale
resources up or down as needed.
▸ Azure includes built-in AI and machine learning services like
Azure Machine Learning, Cognitive Services, and Bot Services
for developing intelligent applications.
26
Setting Up Your Azure
Account and Subscription
• Create a Microsoft account or sign in with an
existing one.
• Choose a suitable subscription plan based on
your needs and budget.
• Set up a resource group to organize your
resources.
• Explore and utilize various Azure services like
27
Section Review
▸ Reviewed development tools
▹ Visual Studio and Visual Studio Code
▸ Review recommended versions
▹ .NET 8 | 9
▸ Reviewed Microsoft Azure
▹ Create free account
28
Build Your Kernal
Section
Overview
▸ What is a kernel and how to build one.
▸ Using Azure OpenAI
▸ Create a chat completion app with Semantic Kernel
30
What is the Kernel?
▸ The kernel is the central component of the Semantic
Kernel.
▸ It can be considered a Dependency Injection
container that manages all the services and plugins
necessary to run your AI application.
▸ All the services you expose to the kernel will be
seamlessly used by the AI as needed.
▸ Any prompt or code run in code using the Semantic
Kernel will use the kernel to retrieve the necessary
services and plugins.
31
Source: [Link]
language-csharp
32
How to build your
kernel
▸
▸
Using the Semantic Kernel SDK takes minimal setup.
We need
▹ The Semantic Kernel SDK package
▹ An endpoint for the large language model (LLM)
service.
▸ The SDK connects to the LLM via the endpoint and runs
prompts.
▸ The Semantic Kernel SDK supports HuggingFace, OpenAI,
and Azure OpenAI LLMs.
▹ For this example, we use Azure OpenAI.
33
Azure AI Services
▸ Azure OpenAI Service: Offers access to powerful language
models like GPT to develop intelligent applications such as
chatbots, content generation, and language translation.
▸ Natural Language Processing (NLP): Azure provides
robust NLP capabilities, allowing developers to analyze text,
extract insights, and perform sentiment analysis through
services like Text Analytics and Language Understanding
(LUIS).
34
What is Azure OpenAI Service?
▸ OpenAI is an artificial intelligence research
company producing services like ChatGPT.
▸ Azure OpenAI Service provides REST API access to
OpenAI's powerful language models like o1-mini,
GPT-4, GPT-4o, and GPT-3.5-Turbo. They perform
tasks like:
▹ content generation,
▹ summarization,
▹ image understanding,
▹ semantic search, and
Demo
▸ [Link]
ur-kernel/4-how-build-your-kernel
▸ [Link]
ur-kernel/6-exercise-build-kernel-object
36
Section Review
▸ Reviewed the kernel
▸ Created an Azure OpenAI resource
▸ Created a GPT 3.5 model deployment
▸ Connected using the Semantic Kernel SDK
▸ Create a chat completion console app
37
Create plugins for
semantic kernel
Section
Overview
▸ Explore plugins
▸ Review prompts with sematic kernel
▸ Techniques for optimal prompts
▸ Reusable prompts
39
What is a plugin?
▸ A plugin is a class that contains functions that can
be run by the kernel.
▸ A plugin function can be made from a semantic
prompt or native function code.
▸ To use a plugin, you add it to the kernel and then
call the desired function using the InvokeAsync
method.
▸ The kernel accesses the plugin, locates and runs the
function, then returns the result.
40
These are available in the [Link] package
Built-in plugins
▸ The Semantic Kernel SDK also offers some built-in
plugins for common tasks;
▹ ConversationSummaryPlugin - Summarizes
conversation
▹ FileIOPlugin - Reads and writes to the
filesystem
▹ HttpPlugin - Makes requests to HTTP endpoints
▹ MathPlugin - Performs mathematical operations
▹ TextPlugin - Performs text manipulation
▹ TimePlugin - Gets time and date information 42
These are available in the [Link] package
Demo
▸ [Link]
reate-plugins-semantic-kernel/3-exercise-use-built-in
-plugins
43
These are available in the [Link] package
Prompts
▸ Prompts are conversational cues you give to large
language models (LLMs).
▸ The LLM will shape responses based on your queries
or instructions.
▸ For example, you can prompt LLMs to convert text
from one language to another, or to generate a
summary of a text.
▸ Prompting involves crafting clear, context rich
instructions to guide the model to generate a
desired response.
▸ 44
These are available in the [Link] package
Tips for effective
prompts
▸ Specific Inputs Yield Specific Outputs: Crafting
clear and specific prompts is crucial to get the
desired output.
▸ Experimentation is Key: You may need to iterate
and experiment with different prompts to
understand how the model interprets and generates
responses.
▸ Context Matters: Ensure that the context is well-
defined and relevant to obtain accurate and
coherent responses.
▸ Length of Prompts: Experimenting with prompt 45
These are available in the [Link] package
Optimizing Prompts
▸ The Semantic Kernel SDK supports a templating
engine that allows you to use expressions and
variables in your natural language prompts.
▸ This means you can create prompts that are
reusable with different input parameters.
▸ Creating reusable prompts is especially useful when
you need to perform the same task with different
inputs.
▸ To embed expressions in your prompts, the
templating language uses curly brackets {{...}}.
46
These are available in the [Link] package
Demo
▸ [Link]
reate-plugins-semantic-kernel/5-exercise-write-your-
own-prompts
47
These are available in the [Link] package
Personas in prompts
▸ Adding a persona to your prompt can improve the
quality of the responses generated by the large
language model (LLM).
▸ Personas provide context to the LLM, allowing it to
consistently generate responses that align better
with your user's intent.
▸ You are a career coach assistant. You are helpful,
creative, and friendly. Consider the professional’s
background: ${careerHistory}
Create a list of helpful career pointers and
suggestions a professional would find useful — 48
These are available in the [Link] package
Personas in prompts
▸ You can also provide instructions to the LLM to
assume a role when generating a response and
provide example requests and responses.
▸ To define a message role, you can wrap the
message in <message> tag with the role name as
an attribute.
▸ The supported roles are 'user', 'system', 'assistant',
and 'bot’.
▹ These refer to how inputs and outputs are
categorized during interactions.
49
These are available in the [Link] package
Personas in prompts
▸ User: Represents the input or instruction provided
by the end-user.
▸ System: Provides initial instructions or context to
guide the AI's behavior throughout the interaction.
▸ Assistant: Represents the AI’s responses or actions
based on the user's input and the system's
instructions.
▸ Bot: A variation of the assistant role that might be
used to emphasize interactions that are distinctly
from a bot in specific implementations. In some
systems, this role overlaps with assistant. 50
These are available in the [Link] package
Personas in prompts
▸ If you're setting up system behavior: Use system to
define rules and context.
▸ If you're inputting a prompt as a user: Use user.
▸ If you're scripting or handling an AI response: Use
assistant (or bot if explicitly needed).
▸ Correctly defining these roles, ensures smooth
interactions and maintains clear distinctions
between inputs, instructions, and AI outputs.
▸ It's crucial to structure interactions based on these
roles for consistency and reliability.
51
These are available in the [Link] package
Saving prompts to files
▸ Organizing your prompts into separate files and
importing them into the kernel is useful for larger
applications.
▸ This is like the way built in plugins are used.
▸ To create your own prompt plugins, a best practice
is to create separate folders for your prompts.
▸ To create a semantic plugin, you need a folder
containing two files:
▹ a [Link] file and
▹ a [Link] file.
52
These are available in the [Link] package
Saving prompts to files
▸ The [Link] file contains the prompt to the
large language model (LLM)
▸ The [Link] file contains the configuration details
like:
▹ type: The type of prompt (like chat completion).
▹ description: A description of what the prompt
does.
▹ input_variables: Defines the variables used
inside of the prompt.
▹ execution_settings: The settings for
53
Section Review
▸ Explored what a plugin is and how to use built-in ones
▸ Review prompts and good prompting practices
▸ Implemented reusable prompt templates
▹ Variables
▹ Personas
▹ Roles
▸ Created a reusable prompt semantic plugin
54
Native Functions
and Plugins
Section
Overview
▸ Understand native functions
▸ Create native functions for plugins
▸ Use native function plugins in AI agent
56
Understanding Native
Funcitons
▸ Native functions are written in native code (C#, Python,
or Java)
▸ These functions are all placed in a class.
▸ They help perform tasks that large language models (LLM)
can't do independently.
▸ Think of them as a skill your application can perform.
▸ You can import your native functions into the kernel as a
plugin.
▹ A class that contains functions that can be invoked
▹ Organized in a single directory
▹ All related functions should be placed in the same
class
57
Demo!!
▸ Exercise - Create native functions - Training | Microsoft Lear
n
58
Combining Functions with
Prompts
▸ Templating in the Semantic Kernel SDK allows you to
create dynamic prompts using:
▹ Variables
▹ External Functions
▹ Arguments
▸ To embed expressions in your prompts, the templating
language uses curly brackets {{...}} and variables are
denoted by a dollar sign $.
▸ Functions can be called in the prompt by using the
following format:
▹ {{[Link] $variable}}
▸ Nesting functions within prompts can help you reduce the
59
Demo
▸ Exercise - Use nested functions for song suggestions - Train
ing | Microsoft Learn
60
Automatic function invocation
▸ Automatic function calling allows the kernel to
automatically select which functions and prompts to use on
some provided input.
▸ This feature can help you save time manually invoke
functions and prompts and make your applications
smarter.
▸ To use automatic function calling, you must use an OpenAI
model that supports it. (GPT-3.5-turbo and GPT-4 models
that are version 0613 or newer).
▸ Function calling allows the AI to invoke functions with the
appropriate parameters in the correct order.
▸ The LLM will iteratively call functions to address the user's
needs through a feedback loop where the AI calls a 61
Demo
▸ Exercise - Automatically invoke functions - Training | Micros
oft Learn
62
Section Review
▸ How to build native functions for plugins
▸ How to use local data to provide context for a prompt,
through native functions
▸ How to embed plugins in prompts
▸ How to auto invoke functions and plugins with prompts
63
“ Quotations are
commonly printed as a
means of inspiration
and to invoke
philosophical thoughts
from the reader.
64
This is a
slide title
▸ Here you have a list of items
▸ And some text
▸ But remember not to overload your
slides with content
Your audience will listen to you or read the
content, but won’t do both.
65
BIG
CONCEPT
Bring the attention of your
audience over a key concept
using icons or illustrations
66
You can also split
your content
White Black
Is the color of milk and Is the color of ebony
fresh snow, the color and of outer space. It
produced by the has been the symbolic
combination of all the color of elegance,
colors of the visible solemnity and
spectrum. authority.
67
In two or three
columns
Yellow Blue Red
Is the color of gold, Is the colour of the clear Is the color of blood, and
butter and ripe lemons. sky and the deep sea. It because of this it has
In the spectrum of is located between violet historically been
visible light, yellow is and green on the optical associated with sacrifice,
found between green spectrum. danger and courage.
and orange.
68
A picture is
worth a
thousand words
A complex idea can be
conveyed with just a single
still image, namely making
it possible to absorb large
amounts of data quickly.
69
Want big impact?
Use big image.
70
Use diagrams to
explain your ideas
Vestibulum Vestibulum Vestibulum congue
congue tempus congue tempus tempus
Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet, consectetur
consectetur adipiscing elit, consectetur adipiscing elit, adipiscing elit, sed do eiusmod tempor. Ipsum
sed do eiusmod tempor. sed do eiusmod tempor. dolor sit amet elit, sed do eiusmod tempor.
71
And tables to
compare data
A B C
Yellow 10 20 7
Blue 30 15 10
Orange 5 24 16
72
Maps Find more maps at [Link]/extra-free-resources-icons-and-maps
our
office
73
89,526,124
Whoa! That’s a big number, aren’t you proud?
74
89,526,124$
That’s a lot of money
185,244
users
And a lot of users
100%
Total success!
75
Our process is
easy 20XX 20XX 20XX 20XX
Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum
Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor
sit amet, sit amet, sit amet, sit amet,
consectetur consectetur consectetur consectetur
adipiscing. adipiscing. adipiscing. adipiscing.
76
Let’s review some
concepts
Yellow Blue Red
Is the color of gold, butter and Is the colour of the clear sky and Is the color of blood, and
ripe lemons. In the spectrum of the deep sea. It is located because of this it has historically
visible light, yellow is found between violet and green on the been associated with sacrifice,
between green and orange. optical spectrum. danger and courage.
Yellow Blue Red
Is the color of gold, butter and Is the colour of the clear sky and Is the color of blood, and
ripe lemons. In the spectrum of the deep sea. It is located because of this it has historically
visible light, yellow is found between violet and green on the been associated with sacrifice,
between green and orange. optical spectrum. danger and courage.
77
400
0
300
0
200
0
100
0
0
You can insert graphs from Excel or Google Sheets
78
Mobile project
Show and explain
your web, app or
software projects
using these gadget
templates.
79
Tablet project
Show and explain
your web, app or
software projects
using these gadget
templates.
80
Desktop
project
Show and explain
your web, app or
software projects
using these gadget
templates.
81
THANKS!
Any questions?
You can find me at:
▸ @username
▸ user@[Link]
82
Credits
Special thanks to all the people who made and
released these awesome resources for free:
▸ Presentation template by SlidesCarnival
▸ Illustrations by Sergei Tikhonov
▸ Photographs by Unsplash
83
Presentation
design
This presentation uses the following
typographies:
▸ Titles: Raleway
▸ Body copy: Barlow
Download for free at:
[Link]
[Link]
You don’t need to keep this slide in your presentation. It’s only here to serve you as a design guide if you
need to create new slides or download the fonts to edit the presentation in PowerPoint®
84
2
Extra
Resources
For Business Plans, Marketing
Plans, Project Proposals, Lessons,
etc
Timeline
Blue is the colour of Black is the color of Yellow is the color of Blue is the colour of
the clear sky and the Red is the colour of ebony and of outer gold, butter and ripe White is the color of the clear sky and the
deep sea danger and courage space lemons milk and fresh snow deep sea
JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
Yellow is the color of White is the color of Blue is the colour of Red is the colour of Black is the color of Yellow is the color
gold, butter and ripe milk and fresh snow the clear sky and the danger and courage ebony and of outer of gold, butter
lemons deep sea space and ripe lemons
86
Roadmap
Blue is the colour of Black is the color of
the clear sky and the Red is the colour of ebony and of outer
deep sea danger and courage space
1 3 5
2 4 6
Yellow is the color of White is the color of Blue is the colour of
gold, butter and ripe milk and fresh snow the clear sky and the
lemons deep sea
87
Gantt chart
Week 1 Week 2
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Task 1
Task 2 ◆
Task 3
Task 4 ◆
Task 5 ◆
Task 6
Task 7
Task 8
88
SWOT Analysis
STRENGTHS WEAKNESSES
Blue is the colour of the Yellow is the color of gold,
clear sky and the deep sea butter and ripe lemons
Black is the color of ebony White is the color of milk
and of outer space and fresh snow
OPPORTUNITIES THREATS
89
Business Model Canvas
Key Partners Key Activities Value Propositions Customer Relationships Customer Segments
Insert your content Insert your content Insert your content Insert your content Insert your content
Key Resources Channels
Insert your content Insert your content
Cost Structure Revenue Streams
Insert your content Insert your content
90
Funnel
AWARENESS Insert your content
DISCOVERY Insert your content
EVALUATION Insert your content
INTENT Insert your content
PURCHASE Insert your content
LOYALTY Insert your content
91
Team Presentation
Imani Jackson Marcos Galán Ixchel Valdía Nils Årud
JOB TITLE JOB TITLE JOB TITLE JOB TITLE
Blue is the colour of the Blue is the colour of the Blue is the colour of the Blue is the colour of the
clear sky and the deep clear sky and the deep clear sky and the deep clear sky and the deep
sea sea sea sea
92
Competitor Matrix
HIGH VALUE 2
Competit
or
Comp
etitor
Our company
Competitor
HIGH VALUE 1
LOW VALUE 1
Competit
or
Competit
Competitor
or
LOW VALUE 2
93
Weekly Planner
SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY
09:00 - 09:45 Task Task Task Task Task Task Task
10:00 - 10:45 Task Task Task Task Task Task Task
11:00 - 11:45 Task Task Task Task Task Task Task
12:00 - 13:15 ✔ Free time ✔ Free time ✔ Free time ✔ Free time ✔ Free time ✔ Free time ✔ Free time
13:30 - 14:15 Task Task Task Task Task Task Task
14:30 - 15:15 Task Task Task Task Task Task Task
15:30 - 16:15 Task Task Task Task Task Task Task
94
Extra
resources
Illustrations created by
Sergei Tikhonov.
Free illustrations
published under the
MIT License. You can
use them for personal
and commercial
projects, without the
need to include
attribution.
See license.
95
Extra
resources
Illustrations created by
Sergei Tikhonov.
Free illustrations
published under the
MIT License. You can
use them for personal
and commercial
projects, without the
need to include
attribution.
See license.
96
SlidesCarnival icons are editable
shapes.
This means that you can:
▸ Resize them without losing
quality.
▸ Change fill color and opacity.
▸ Change line color, width and
style.
Isn’t that nice? :)
Examples:
Find more icons at
[Link]/extra-free-resources-ic
ons-and-maps
97
Diagrams and infographics
98
You can also use any emoji as an icon!
And of course it resizes without losing quality.
How? Follow Google instructions
[Link]
✋👆👉👍👤👦👧👨👩👪💃🏃💑❤😂😉😋😒😭👶
😸🐟🍒🍔💣📌📖🔨🎃🎈🎨🏈🏰🌏🔌🔑 and many
more...
99
Free templates for all your presentation needs
For PowerPoint and 100% free for Ready to use, Blow your audience
Google Slides personal or professional and away with attractive
commercial use customizable visuals