What are Plugins?

pink circles of semantic kernel

A plugin refers to a domain of expertise made available to the kernel as a single function, or as a group of functions related to the plugin. The design of Semantic Kernel plugins has prioritized maximum flexibility for the developer to be both lightweight and extensible.

Tip

Try the Simple chat summary sample app to quickly see Plugins in action.

What is a Function?

Diagram showing how plugins can work

A function is the basic building block for a plugin. A function can be expressed as either:

  1. an LLM AI prompt — also called a "semantic" function
  2. native computer code -- also called a "native" function

When using native computer code, it's also possible to invoke an LLM AI prompt — which means that there can be functions that are hybrid LLM AI × native code as well.

Functions can be connected end-to-end, or "chained together," to create more powerful capabilities. When they are represented as pure LLM AI prompts in semantic functions, the word "function" and "prompt" can be used interchangeably.

What is the relationship between semantic functions and plugins?

A plugin is the container in which functions live. You can think of a semantic plugin as a directory of folders that contain multiple directories of semantic functions or a single directory as well.

PluginName (directory name)
│
└─── Function1Name (directory name)
│   
└─── Function2Name (directory name)

Each function directory will have an skprompt.txt file and a config.json file. There's much more to learn about semantic functions in Building Semantic Functions if you wish to go deeper.

What is the relationship between native functions and plugins?

Native functions are loosely inspired by Azure Functions and exist as individual native plugin files as in MyNativePlugin.cs below:

MyAppSource
│
└───MyPluginsDirectory
    │
    └─── MySemanticPlugin (a directory)
    |   │
    |   └─── MyFirstSemanticFunction (a directory)
    |   └─── MyOtherSemanticFunction (a directory)
    │
    └─── MyNativePlugin.cs (a file)
    └─── MyOtherNativePlugin.cs (a file)

Each file will contain multiple native functions that are associated with a plugin.

Where to find plugins in the GitHub repo

Plugins are stored in one of three places:

  1. Core Plugins: these are plugins available at any time to the kernel that embody a few standard capabilities like working with time, text, files, http requests, and the Planner.

semantic-kernel/dotnet/src/SemanticKernel/CorePlugins

  1. Semantic Plugins: these plugins are managed by you in a directory of your choice.

  2. Native Plugins: these plugins are also managed by you in a directory of your choice.

For more examples of plugins, and the ones that we use in our sample apps, look inside:

semantic-kernel/samples/skills

Take the next step