# microsoftlearning/mslearn-ai-semantic-kernel architecture

> Architecture diagram of the GitHub repository microsoftlearning/mslearn-ai-semantic-kernel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoftlearning/mslearn-ai-semantic-kernel
- Repository: https://github.com/microsoftlearning/mslearn-ai-semantic-kernel

## Overview

##### Project type and purpose
- This repo is a **hands-on tutorial** consisting of five lab exercises (“Labfiles/01-05”) showing how to build generative AI apps using **Azure OpenAI** and the **Semantic Kernel** SDK.
- Each lab provides **sample code** in both **C# (.NET)** and **Python**, along with configuration files and data assets, so students can compare implementations side-by-side.

##### File structure
- **Top-level**
- `.gitignore`, `LICENSE`, `README.md`, `Instructions/` (Markdown guides), `index.md`
- `Labfiles/` (the actual lab projects)
- **Per-lab folders** (`Labfiles/01-build-your-kernel`, …, `Labfiles/05-ai-assistant`) each contain:
- A `C-sharp/` subfolder: `.csproj`, `Program.cs`, `appsettings.json`, plugin or filter classes (`FlightBookingPlugin.cs`, `Filters.cs`), sample data (`flights.json`), build logs, etc.
- A `Python/` subfolder: `.env`, `kernel.py` or `prompts.py`, plugin modules, data JSON, `devops.py` in the final lab.
- **Configuration files** (`.env`, `appsettings.json`) hold keys and endpoint URLs for Azure resources.
- **Data files** (`flights.json`) drive plugin examples.
- **Instruction docs** in `Instructions/Labs/` map to the lab code under `Labfiles/`.

##### Key insights from the README
- The repo is **educational**, aligned with a Microsoft Learn path.
- Emphasizes use of **Azure subscription**, **Azure OpenAI models**, and **Semantic Kernel** as the orchestration layer.
- No single “running system” but five modular exercises demonstrating kernel-building, prompt execution, plugin creation, function filtering and an AI assistant pipeline.

##### Detail is key
- Break each lab into its core **orchestration**, **plugin**, and **data** components.
- Don’t just show “Backend” and “Frontend” – instead illustrate the **kernel**, **function filters**, **prompt runners**, and **external AI service**.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Developer["Developer Machine / IDE"]:::external
    SourceRepo["Source Repository\n(README.md, Instructions/)"]:::repo
    CI_CD["CI/CD (GitHub Actions)"]:::ci
    AzureOpenAI["Azure OpenAI Service"]:::azure

    Developer -->|clones| SourceRepo
    Developer -->|runs labs| Labs

    subgraph "Lab 01 - Build Your Kernel"
        direction TB
        subgraph CSharp01
            direction TB
            CSharpLab01["C# Kernel Host"]:::code
            CS01_Inst["Program.cs"]:::code
            CS01_Config["appsettings.json"]:::code
            CS01_Lib["Kernel.csproj"]:::code
        end
        subgraph Python01
            direction TB
            PythonLab01["Python Kernel Host"]:::code
            Py01_Script["kernel.py"]:::code
            Py01_Env[".env"]:::code
        end
        CSharpLab01 -->|uses| CS01_Inst
        CSharpLab01 -->|reads| CS01_Config
        CSharpLab01 -->|references| CSharp01
        PythonLab01 -->|uses| Py01_Script
        PythonLab01 -->|reads| Py01_Env
        CSharpLab01 -->|calls| SK01["Semantic Kernel SDK"]:::orchestration
        PythonLab01 -->|calls| SK01
    end

    subgraph "Lab 02 - Run Prompts"
        direction TB
        subgraph CSharp02
            direction TB
            CSharpLab02["C# Prompt Runner"]:::code
            CS02_Inst["Program.cs"]:::code
            CS02_Config["appsettings.json"]:::code
            CS02_Lib["Prompts.csproj"]:::code
        end
        subgraph Python02
            direction TB
            PythonLab02["Python Prompt Runner"]:::code
            Py02_Script["prompts.py"]:::code
            Py02_Env[".env"]:::code
        end
        CSharpLab02 -->|calls| SK02["Semantic Kernel SDK"]:::orchestration
        PythonLab02 -->|calls| SK02
    end

    subgraph "Lab 03 - Create Plugins"
        direction TB
        subgraph CSharp03
            direction TB
            CSharpLab03["C# Plugin Host"]:::code
            CS03_Inst["Program.cs"]:::code
            CS03_Plugin["FlightBookingPlugin.cs"]:::code
            CS03_Data["flights.json"]:::data
            CS03_Config["appsettings.json"]:::code
            CS03_Lib["Plugins.csproj"]:::code
        end
        subgraph Python03
            direction TB
            PythonLab03["Python Plugin Host"]:::code
            Py03_Script["plugins.py"]:::code
            Py03_Plugin["flight_booking_plugin.py"]:::code
            Py03_Data["flights.json"]:::data
            Py03_Env[".env"]:::code
        end
        CSharpLab03 -->|loads| CS03_Plugin
        PythonLab03 -->|loads| Py03_Plugin
        CSharpLab03 -->|uses| CS03_Data
        PythonLab03 -->|uses| Py03_Data
        CSharpLab03 -->|calls| SK03["Semantic Kernel SDK"]:::orchestration
        PythonLab03 -->|calls| SK03
    end

    subgraph "Lab 04 - Apply Function Filters"
        direction TB
        subgraph CSharp04
            direction TB
            CSharpLab04["C# Filter Pipeline"]:::code
            CS04_Inst["Program.cs"]:::code
            CS04_Filter["Filters.cs"]:::code
            CS04_Plugin["FlightBookingPlugin.cs"]:::code
            CS04_Data["flights.json"]:::data
            CS04_Config["appsettings.json"]:::code
            CS04_Lib["Filters.csproj"]:::code
        end
        subgraph Python04
            direction TB
            PythonLab04["Python Filter Pipeline"]:::code
            Py04_Script["filters.py"]:::code
            Py04_Plugin["flight_booking_plugin.py"]:::code
            Py04_Data["flights.json"]:::data
            Py04_Env[".env"]:::code
        end
        CSharpLab04 -->|applies| CS04_Filter
        PythonLab04 -->|applies| Py04_Script
        CSharpLab04 -->|calls| SK04["Semantic Kernel SDK"]:::orchestration
        PythonLab04 -->|calls| SK04
    end

    subgraph "Lab 05 - AI Assistant Pipeline"
        direction TB
        subgraph CSharp05
            direction TB
            CSharpLab05["C# Assistant Host"]:::code
            CS05_Inst["Program.cs"]:::code
            CS05_Config["appsettings.json"]:::code
            CS05_Lib["new-sk-labs.csproj"]:::code
            CS05_Logs["Files/build.log"]:::data
        end
        subgraph Python05
            direction TB
            PythonLab05["Python DevOps Script"]:::code
            Py05_Script["devops.py"]:::code
            Py05_Env[".env"]:::code
            Py05_Logs["Files/build.log"]:::data
        end
        CSharpLab05 -->|runs| CS05_Inst
        PythonLab05 -->|runs| Py05_Script
        CSharpLab05 -->|calls| SK05["Semantic Kernel SDK"]:::orchestration
        PythonLab05 -->|calls| SK05
        CSharpLab05 -->|reports| CS05_Logs
        PythonLab05 -->|reports| Py05_Logs
    end

    SK01 -->|sends prompts| AzureOpenAI -->|returns completions| SK01
    SK02 -->|sends prompts| AzureOpenAI -->|returns completions| SK02
    SK03 -->|sends prompts| AzureOpenAI -->|returns completions| SK03
    SK04 -->|sends prompts| AzureOpenAI -->|returns completions| SK04
    SK05 -->|sends prompts| AzureOpenAI -->|returns completions| SK05

    class Developer,SourceRepo external
    class SSHotel09 repo
    class CI_CD ci
    class AzureOpenAI azure
    class CSharpLab01,CSharpLab02,CSharpLab03,CSharpLab04,CSharpLab05,PythonLab01,PythonLab02,PythonLab03,PythonLab04,PythonLab05 code
    class SK01,SK02,SK03,SK04,SK05 orchestration
    class CS03_Data,Py03_Data,CS04_Data,Py04_Data,CS05_Logs,Py05_Logs data

    click SourceRepo "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/blob/main/README.md"
    click SourceRepo "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/tree/main/Instructions/"
    click CSharpLab01 "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/tree/main/Labfiles/01-build-your-kernel/C-sharp/"
    click CS01_Inst "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/blob/main/Labfiles/01-build-your-kernel/C-sharp/Program.cs"
    click PythonLab01 "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/tree/main/Labfiles/01-build-your-kernel/Python/"
    click Py01_Script "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/blob/main/Labfiles/01-build-your-kernel/Python/kernel.py"
    click CSharpLab02 "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/tree/main/Labfiles/02-run-prompts/C-sharp/"
    click PythonLab02 "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/tree/main/Labfiles/02-run-prompts/Python/"
    click CSharpLab03 "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/tree/main/Labfiles/03-create-plugins/C-sharp/"
    click CS03_Plugin "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/blob/main/Labfiles/03-create-plugins/C-sharp/FlightBookingPlugin.cs"
    click CS03_Data "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/blob/main/Labfiles/03-create-plugins/C-sharp/flights.json"
    click PythonLab03 "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/tree/main/Labfiles/03-create-plugins/Python/"
    click Py03_Plugin "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/blob/main/Labfiles/03-create-plugins/Python/flight_booking_plugin.py"
    click Py03_Data "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/blob/main/Labfiles/03-create-plugins/Python/flights.json"
    click CSharpLab04 "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/tree/main/Labfiles/04-apply-function-filters/C-sharp/"
    click PythonLab04 "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/tree/main/Labfiles/04-apply-function-filters/Python/"
    click CSharpLab05 "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/tree/main/Labfiles/05-ai-assistant/c-sharp/"
    click PythonLab05 "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/tree/main/Labfiles/05-ai-assistant/python/"
    click Py05_Script "https://github.com/microsoftlearning/mslearn-ai-semantic-kernel/blob/main/Labfiles/05-ai-assistant/python/devops.py"
```
