Introduction to Semantic Kernel

Ali Issa · Beginner ·🧠 Large Language Models ·1y ago

Key Takeaways

This video introduces Semantic Kernel, a lightweight open-source SDK for integrating large language models into applications, and demonstrates how to connect it to Azure Open AI GPT-4o and execute a prompt using C# and Visual Studio Code.

Full Transcript

hello everyone and welcome to the first video in my series on semantic konel my name is Ali Isa and I work as an AI lead at a company based in Sweden it's my job to innovate and experiment with Cutting Edge technology within AI such as semantic kernel so I'm really excited to share with you what I have learned about this powerful SDK if you find this content interesting please subscribe to the channel and hit the Bell icon to get notified about our future videos let's dive in today's agenda is as follows I will start by describing what semantic kernel is and what it's used for then I will walk you through a simple example of how to connect it to Azure open AI GPT 40 and execute a prompt in future videos we'll dive deeper into more advanced features and use cases but today we'll start with the basics so what is semantic kernel semantic kernel is a lightweight open-source SDK designed to simplify the integration of large language models into applications whether you're working with C python or Java semantic kernel abstracts away much of the complexity it spares you the need to keep track of constantly evolving AI apis as semantic kernel handles the calls to the underlying AI models this abstraction is crucial given the rapid pace of innovation within the AI field furthermore semantic kernel can be used to connect to various AI models this includes models available in Azure open AI open Ai and hugging face this flexibility ensures you can leverage the best AI tool tools available based on your needs semantic kernel is also highly extendable you can add your own custom functions tailoring the framework to meet your specific needs this flexibility is a significant Advantage for developers looking to customize their AI applications all these capabilities make semantic kernel an excellent SDK for building AI agents that can answer questions or automate complicated processes it was in fact designed to power products such as Microsoft 365 co-pilot and Bing co-pilot now let's move on to the Practical part we'll walk through a simple example of how to connect semantic kernel to Azure open AI GPT 4 and execute a prompt first let's go over some prerequisites to be able to access and use large language models available in Azure open AI you need to obtain an API key please note that calls to Azure open AI API will incur costs all right after that you need to launch Visual Studio code navigate to the terminal and type the following command to create a console application net new console dasos introduction next you need to navigate to the application directory and then add the semantic kernel nougat package by typing the following command in the terminal net add package microsoft. semantic kernel double- pre-release all right now we are good to go let's have a look at the code let's walk through this simple project step by step first we have our necessary Imports these give us access to the tools we need including semantic C and the ability to load environment variables and here we have our main method we start by loading our environment variables using en load which reads my EnV file and loads the variables into our application in this file I have defined the API key the endpoint and the deployment name of my GPT 40 model in Azure open AI next we declare new variables and assign them values from our environment this gives us local variables containing our Azure open AI configuration details after that we do a quick check to make sure all our necessary variables are not null or empty now the exciting part we create our kernel and use the ad Azure open AI chat completion method to connect to the chat Services as you can see the arguments in this method is the deployment name the endpoint and the API key with that done the kernel is now ready to interact with gp40 next we Define a prompt which is the text instruction we give to gp40 to generate a response in this case The Prompt is tell a funny and playful joke about how you gp40 are better than llama 3.1 the latest large language model released by meta after that we invoke The Prompt and await the result finally we output the result and have exception handling so let's run this code and there you go we have got a joke back and it says why did GPT 40 challenge llama 3.1 to a duel because it heard llas are great at spitting facts but GPT 40 is better at bite-sized humor well I think we could all agree that GPT 40 won't become a comedian anytime soon all right guys that was it for this video I hope it spurred your interest in semantic kernel and showed you just how simple and Powerful it is make sure to subscribe for more videos on semantic kernel and other exciting AI topics leave a comment below with your thoughts or any questions you have thanks for watching and I'll see you in the next video

Original Description

In this video, I introduce you to Semantic Kernel, a powerful tool for AI development. We walk through a simple example where we execute a prompt to GPT-4o and receive a response. #semantickernel #gpt4o #ai #aiagent #chatgpt
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

This video introduces Semantic Kernel and demonstrates how to connect it to Azure Open AI GPT-4o and execute a prompt. Semantic Kernel is a powerful tool for AI development that simplifies the integration of large language models into applications.

Key Takeaways
  1. Obtain an API key for Azure Open AI
  2. Launch Visual Studio Code and create a new console application
  3. Add the Semantic Kernel NuGet package
  4. Load environment variables
  5. Create a kernel and connect to Azure Open AI chat completion
  6. Define a prompt and invoke it
  7. Output the result and handle exceptions
💡 Semantic Kernel abstracts away much of the complexity of integrating large language models into applications, making it easier to build AI-powered products and services.

Related AI Lessons

Sub-10ms AI Workflows: Accelerating sim.ai with On-Device Semantic Search using Moss
Learn how to accelerate AI workflows with on-device semantic search using Moss, achieving sub-10ms response times and improving user experience
Medium · Machine Learning
Stop Guessing: Guaranteed Structured Output from LLMs in Node.js
Learn to guarantee structured output from LLMs in Node.js and stop parsing JSON manually
Dev.to · Hardik Mehta
Spring AI Tutorial — Your First REST Endpoint with OpenAI (2026)
Build a REST endpoint with Spring Boot 3 and OpenAI to create an LLM-powered API, leveraging the power of AI in your applications
Dev.to AI
Notes: Memory, Context, and Large Language Models (LLMs)
Learn how memory and context work in Large Language Models (LLMs) and potential improvements
Dev.to · Vladimir Panov
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →