### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Mark Wallace <[email protected]> Co-authored-by: Teresa Hoang <[email protected]> Co-authored-by: Gil LaHaye <[email protected]> Co-authored-by: Craig Presti <[email protected]> Co-authored-by: adityachallapally <[email protected]> Co-authored-by: Devis Lucato <[email protected]> Co-authored-by: Gina Triolo <[email protected]> Co-authored-by: Adrian Bonar <[email protected]> Co-authored-by: Gudge <[email protected]> Co-authored-by: Shawn Callegari <[email protected]> Co-authored-by: Roger Barreto <[email protected]> Co-authored-by: Stephen Toub <[email protected]> Co-authored-by: Jadyn <[email protected]> Co-authored-by: Lee Miller <[email protected]> Co-authored-by: name <email> Co-authored-by: Milder Hernandez Cagua <[email protected]> Co-authored-by: Milder Hernandez <[email protected]> Co-authored-by: Yoshio Terada <[email protected]> Co-authored-by: Almir Kazazic <[email protected]> Co-authored-by: Alexander Siniouguine <[email protected]> Co-authored-by: Harleen Thind <[email protected]> Co-authored-by: David Barkol <[email protected]> Co-authored-by: Mark Karle <[email protected]> Co-authored-by: poweihuang0817 <[email protected]> Co-authored-by: Po-Wei Huang <[email protected]> Co-authored-by: Ikko Eltociear Ashimine <[email protected]> Co-authored-by: Adrian Bonar (HE/HIM) <[email protected]> Co-authored-by: Tao Chen <[email protected]> Co-authored-by: Vivien Hung <[email protected]> Co-authored-by: Abby Harrison <[email protected]> Co-authored-by: Abby Harrison <[email protected]> Co-authored-by: Devis Lucato <[email protected]> Co-authored-by: fabio fumarola <[email protected]> Co-authored-by: cdMSFT <[email protected]> Co-authored-by: Dmytro Struk <[email protected]> Co-authored-by: Lex Li <[email protected]> Co-authored-by: Damir Dobric <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Aman Sachan <[email protected]> Co-authored-by: Joowon <[email protected]> Co-authored-by: Richard Edgar <[email protected]> Co-authored-by: nacharya1 <[email protected]> Co-authored-by: Kevdome3000 <[email protected]> Co-authored-by: tech <[email protected]> Co-authored-by: Masumi Morishige <[email protected]> Co-authored-by: Alex Chao <[email protected]> Co-authored-by: Alex Chao <[email protected]> Co-authored-by: markwallace-microsoft <[email protected]> Co-authored-by: David Grieve <[email protected]> Co-authored-by: Bruno Borges <[email protected]> Co-authored-by: Martijn Verburg <[email protected]> Co-authored-by: Luigi Montoya <[email protected]> Co-authored-by: joe-braley <[email protected]> Co-authored-by: Luigi96 <[email protected]> Co-authored-by: GitHub <[email protected]> Co-authored-by: Derek Keeler <[email protected]> Co-authored-by: Joe Braley <[email protected]> Co-authored-by: Craig Presti <[email protected]> Co-authored-by: cschadewitz <[email protected]> Co-authored-by: Desmond Howard <[email protected]> Co-authored-by: Jean-Sylvain Boige <[email protected]> Co-authored-by: Dave Arlin <[email protected]> Co-authored-by: Ben Thomas <[email protected]> Co-authored-by: Ben Thomas <[email protected]> Co-authored-by: Sebastian Santoyo <[email protected]> Co-authored-by: sneha <[email protected]> Co-authored-by: Alisha Maddy <[email protected]> Co-authored-by: Alisha Maddy <[email protected]> Co-authored-by: Sneha <[email protected]> Co-authored-by: Guy Bowerman <[email protected]> Co-authored-by: kshitijcode <[email protected]> Co-authored-by: dantelmomsft <[email protected]> Co-authored-by: Vikram Seshadri <[email protected]>
Semantic Kernel
Semantic Kernel is an SDK that integrates Large Language Models (LLMs) like OpenAI, Azure OpenAI, and Hugging Face with conventional programming languages like C#, Python, and Java. Semantic Kernel achieves this by allowing you to define plugins that can be chained together in just a few lines of code.
What makes Semantic Kernel special, however, is its ability to automatically orchestrate plugins with AI. With Semantic Kernel planners, you can ask an LLM to generate a plan that achieves a user's unique goal. Afterwards, Semantic Kernel will execute the plan for the user.
Please star the repo to show your support for this project!
Getting started with Semantic Kernel
The Semantic Kernel SDK is available in C#, Python, and Java. To get started, choose your preferred language below. See the Feature Matrix to see a breakdown of feature parity between our currently supported languages.
|
|
|
The quickest way to get started with the basics is to get an API key from either OpenAI or Azure OpenAI and to run one of the C#, Python, and Java console applications/scripts below.
For C#:
- Create a new console app.
- Add the semantic kernel nuget
Microsoft.SemanticKernel. - Copy the code from here into the app
Program.csfile. - Replace the configuration placeholders for API key and other params with your key and settings.
- Run with
F5ordotnet run
For Python:
- Install the pip package:
python -m pip install semantic-kernel. - Create a new script e.g.
hello-world.py. - Store your API key and settings in an
.envfile as described here. - Copy the code from here into the
hello-world.pyscript. - Run the python script.
For Java:
- Clone and checkout the experimental Java branch:
git clone -b experimental-java https://github.com/microsoft/semantic-kernel.git - Follow the instructions here
Learning how to use Semantic Kernel
The fastest way to learn how to use Semantic Kernel is with our C# and Python Jupyter notebooks. These notebooks demonstrate how to use Semantic Kernel with code snippets that you can run with a push of a button.
Once you've finished the getting started notebooks, you can then check out the main walkthroughs on our Learn site. Each sample comes with a completed C# and Python project that you can run locally.
- 📖 Overview of the kernel
- 🔌 Understanding AI plugins
- 👄 Creating semantic functions
- 💽 Creating native functions
- ⛓️ Chaining functions together
- 🤖 Auto create plans with planner
- 💡 Create and run a ChatGPT plugin
Finally, refer to our API references for more details on the C# and Python APIs:
- C# API reference
- Python API reference (coming soon)
Chat Copilot: see what's possible with Semantic Kernel
If you're interested in seeing a full end-to-end example of how to use Semantic Kernel, check out our Chat Copilot reference application. Chat Copilot is a chatbot that demonstrates the power of Semantic Kernel. By combining plugins, planners, and personas, we demonstrate how you can build a chatbot that can maintain long-running conversations with users while also leveraging plugins to integrate with other services.
You can run the app yourself by downloading it from its GitHub repo.
Visual Studio Code extension: design semantic functions with ease
The Semantic Kernel extension for Visual Studio Code makes it easy to design and test semantic functions. The extension provides an interface for designing semantic functions and allows you to test them with a push of a button with your existing models and data.
In the above screenshot, you can see the extension in action:
- Syntax highlighting for semantic functions
- Code completion for semantic functions
- LLM model picker
- Run button to test the semantic function with your input data
Check out our other repos!
If you like Semantic Kernel, you may also be interested in other repos the Semantic Kernel team supports:
| Repo | Description |
|---|---|
| Chat Copilot | A reference application that demonstrates how to build a chatbot with Semantic Kernel. |
| Semantic Kernel Docs | The home for Semantic Kernel documentation that appears on the Microsoft learn site. |
| Semantic Kernel Starters | Starter projects for Semantic Kernel to make it easier to get started. |
| Kernel Memory | A scalable Memory service to store information and ask questions using the RAG pattern. |
Join the community
We welcome your contributions and suggestions to SK community! One of the easiest ways to participate is to engage in discussions in the GitHub repository. Bug reports and fixes are welcome!
For new features, components, or extensions, please open an issue and discuss with us before sending a PR. This is to avoid rejection as we might be taking the core in a different direction, but also to consider the impact on the larger ecosystem.
To learn more and get started:
- Read the documentation
- Learn how to contribute to the project
- Join the Discord community
- Attend regular office hours and SK community events
- Follow the team on our blog
Code of Conduct
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
License
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT license.



