Delv
Semantic Kernel
Getting Started Guide

How to Use Semantic Kernel

A practical guide to get you up and running with Semantic Kernel. Written by Delv Editorial, Delv Team.

Getting started with Semantic Kernel

In this guide, you will learn how to set up Semantic Kernel and create your first AI integration. After following these steps, you will be able to use Microsoft’s SDK to connect AI services to your applications using C#, Python, or Java.

Step 1: Sign up and set up

  1. Visit the Semantic Kernel website.
  2. Scroll down to the "Get Started" section and click on the "Download" button to access the SDK.
  3. Choose the appropriate version for your programming language (C#, Python, or Java) and follow the installation instructions provided on the site.
  4. If you need a code editor, download Visual Studio for C# or PyCharm for Python from their respective websites.

Step 2: Your first integration

  1. Open your code editor and create a new project in your chosen language.
  2. Install the Semantic Kernel package. For example, in Python, run:
pip install semantic-kernel
  1. Import the Semantic Kernel library in your code:
from semantic_kernel import Kernel
  1. Initialise the Kernel:
kernel = Kernel()
  1. Create a simple AI task. For example, to generate a response based on a prompt:
response = kernel.run("What is the capital of France?")
   print(response)
  1. Save and run your project to see the output.

Step 3: Get better results

  1. Explore the available plugins and memory features in the Semantic Kernel documentation to enhance your application’s functionality.
  2. Use the kernel.add_plugin() method to integrate additional capabilities into your project.
  3. Adjust the parameters of your tasks for better responses. For example, you can specify the temperature settings for more creative outputs.

Pro tip

Take advantage of the community GitHub repository for Semantic Kernel. You can find pre-built plugins and examples that can save you time in development. Simply clone the repository and adapt the code to fit your needs.

Common mistake to avoid

Many beginners overlook the importance of setting up the environment correctly. Ensure you have the necessary dependencies installed and configured in your project settings to avoid runtime errors. Always check the documentation for any additional setup requirements specific to your programming language.