Sunday, October 26, 2025
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Unlock Your Potential With AI | AI Mind Center
  • AI News & Trends
    • All
    • AI Model Releases
    Gemini2.5 Pro (I/O edition) First Look: How to Get Access

    Gemini2.5 Pro (I/O edition) First Look: How to Get Access

    May the Fourth be with you: Launching AI MIND CENTER

    May the Fourth be with you: Launching AI MIND CENTER

  • AI Tools for Productivity
    • All
    • AI Personal Assistants
    • AI Productivity Apps
    • AI Time Management
    • AI Workflow Automation
    Step-by-Step: Setting Up Microsoft.Extensions.AI

    Step-by-Step: Setting Up Microsoft.Extensions.AI

    Running IA Locally with Ollama with .NET

    Running IA Locally with Ollama with .NET

    ⚡ Best AI Writing Tools 2025: Transform Your Content Creation Game

    ⚡ Best AI Writing Tools 2025: Transform Your Content Creation Game

    AI Workflow Automation: Build Advanced Solutions Without Code (Even Developers Are Impressed)

    AI Workflow Automation: Build Advanced Solutions Without Code (Even Developers Are Impressed)

    Bubble No-Code: Why IT Experts Struggle (And How You Can Profit)

    Bubble No-Code: Why IT Experts Struggle (And How You Can Profit)

    7 AI Game Development Tools that Are Changing the Industry

    7 AI Game Development Tools that Are Changing the Industry

  • AI for Developers
    • All
    • AI APIs & Libraries
    • AI Assisted Coding
    • AI Implementation Projects
    Step-by-Step: Setting Up Microsoft.Extensions.AI

    Step-by-Step: Setting Up Microsoft.Extensions.AI

    Running IA Locally with Ollama with .NET

    Running IA Locally with Ollama with .NET

    How to Use GitHub Copilot X: From Beginner to Advanced (Complete 2025 Guide)

    Getting Started with OpenAI’s API: A Practical Guide for Developers (2025 Edition)

    Getting Started with OpenAI’s API: A Practical Guide for Developers (2025 Edition)

    Top 15 AI Tools Every Developer Should Be Using in 2025

    Top 15 AI Tools Every Developer Should Be Using in 2025

  • AI in Game Development
    • All
    • AI for NPCs & Game Characters
    • AI Game Design Tools
    • AI Game Optimization
    • AI Procedural Generation

    The Ultimate Guide to AI-Generated Assets in Unreal Engine 5.3

    7 AI Game Development Tools that Are Changing the Industry

    7 AI Game Development Tools that Are Changing the Industry

  • AI Tools Reviews
No Result
View All Result
  • AI News & Trends
    • All
    • AI Model Releases
    Gemini2.5 Pro (I/O edition) First Look: How to Get Access

    Gemini2.5 Pro (I/O edition) First Look: How to Get Access

    May the Fourth be with you: Launching AI MIND CENTER

    May the Fourth be with you: Launching AI MIND CENTER

  • AI Tools for Productivity
    • All
    • AI Personal Assistants
    • AI Productivity Apps
    • AI Time Management
    • AI Workflow Automation
    Step-by-Step: Setting Up Microsoft.Extensions.AI

    Step-by-Step: Setting Up Microsoft.Extensions.AI

    Running IA Locally with Ollama with .NET

    Running IA Locally with Ollama with .NET

    ⚡ Best AI Writing Tools 2025: Transform Your Content Creation Game

    ⚡ Best AI Writing Tools 2025: Transform Your Content Creation Game

    AI Workflow Automation: Build Advanced Solutions Without Code (Even Developers Are Impressed)

    AI Workflow Automation: Build Advanced Solutions Without Code (Even Developers Are Impressed)

    Bubble No-Code: Why IT Experts Struggle (And How You Can Profit)

    Bubble No-Code: Why IT Experts Struggle (And How You Can Profit)

    7 AI Game Development Tools that Are Changing the Industry

    7 AI Game Development Tools that Are Changing the Industry

  • AI for Developers
    • All
    • AI APIs & Libraries
    • AI Assisted Coding
    • AI Implementation Projects
    Step-by-Step: Setting Up Microsoft.Extensions.AI

    Step-by-Step: Setting Up Microsoft.Extensions.AI

    Running IA Locally with Ollama with .NET

    Running IA Locally with Ollama with .NET

    How to Use GitHub Copilot X: From Beginner to Advanced (Complete 2025 Guide)

    Getting Started with OpenAI’s API: A Practical Guide for Developers (2025 Edition)

    Getting Started with OpenAI’s API: A Practical Guide for Developers (2025 Edition)

    Top 15 AI Tools Every Developer Should Be Using in 2025

    Top 15 AI Tools Every Developer Should Be Using in 2025

  • AI in Game Development
    • All
    • AI for NPCs & Game Characters
    • AI Game Design Tools
    • AI Game Optimization
    • AI Procedural Generation

    The Ultimate Guide to AI-Generated Assets in Unreal Engine 5.3

    7 AI Game Development Tools that Are Changing the Industry

    7 AI Game Development Tools that Are Changing the Industry

  • AI Tools Reviews
No Result
View All Result
Unlock Your Potential With AI | AI Mind Center
No Result
View All Result
Home Uncategorized

Streamlining Workflows with Semantic Kernel

Felipe Machado by Felipe Machado
September 26, 2025
in Uncategorized
10
0
Streamlining Workflows with Semantic Kernel
18
SHARES
151
VIEWS
Share on FacebookShare on XShare on Linkedin

Introduction

Imagine orchestrating AI to manage product data or generate content effortlessly, all within a .NET app that integrates seamlessly with your favorite tools. At AI Mind Center, I use Semantic Kernel, a powerful SDK developed by Microsoft for .NET, Java, and Python, to streamline workflows like managing blog data. As one of the favorite SDKs in the market, Semantic Kernel offers full .NET support, unlike LangChain, which is Python-only. Whether you’re a developer building apps, a tester validating outputs, or a business analyst optimizing processes, this SDK simplifies AI integration. In this guide, I’ll show you how to set up Semantic Kernel with a .NET app to interact with AI, using my blog as a practical example. Perfect for tech enthusiasts, this post is your entry point to smarter AI workflows.

Why Semantic Kernel?

Semantic Kernel, developed by Microsoft, is an open-source SDK that orchestrates AI tasks, combining large language models (LLMs), plugins, and data sources for seamless automation. It’s ideal for tasks like generating blog outlines or managing product inventories, as I do for AI Mind Center. Key benefits include:

  • Orchestration: Chains prompts and plugins for complex tasks.
  • Plugins: Execute custom C# code, like querying data, during AI interactions.
  • Flexibility: Supports local and cloud AI (e.g., Ollama, OpenAI).
  • .NET Integration: Leverages .NET’s features, like dependency injection.

Think of Semantic Kernel as a conductor, directing AI and code to create harmonious workflows for any tech project.

Prerequisites

To get started with Semantic Kernel and .NET, you’ll need:

  • Hardware: A machine with at least 8GB RAM and a decent CPU or GPU. I use an NVIDIA RTX-4060 with 8GB VRAM, which handles models like llama3.1:latest smoothly. Most modern laptops or desktops (e.g., 16GB RAM) work well.
  • Operating System: Windows, Linux, or macOS. I tested this on Windows 11, but it’s cross-platform.
  • .NET Environment: .NET 8 SDK, installed via Visual Studio or the .NET CLI.
  • Ollama: Download from ollama.com. Installation is simple—download the installer for your OS and run it, no complex configuration needed.
  • NuGet Packages: Installed via the CLI or Visual Studio (detailed below).
  • Optional Database: For advanced integrations, a database like SQL Server or PostgreSQL can store data (e.g., product records), but this guide starts with a simple plugin.

Verify Ollama installation by opening a terminal and typing:

ollama

This shows Ollama’s command-line help. Check the API endpoint at http://localhost:11434 in your browser; it should display “Ollama is running”.

Step-by-Step: Setting Up Semantic Kernel

Here’s how I set up Semantic Kernel with .NET for AI Mind Center, keeping it simple for your first AI experience:

  1. Install Ollama
    Download the installer from ollama.com and run it. The process is straightforward—follow the prompts, and Ollama sets up in minutes. Verify with:
  1. ollamaCheck http://localhost:11434 in your browser to see “Ollama is running”.
  2. Choose and Manage Models
    I chose the llama3.1:latest model for its robust text capabilities, ideal for managing blog data. Explore other models at ollama.com/library. Manage models with:
    • List Models: View installed models:ollama list
    • Download Model: Pull llama3.1:latest:ollama pull llama3.1:latest
    • Run Model: Start the model:ollama run llama3.1
  1. Create a .NET Project
    In a terminal, create a .NET 8 console app named SemanticKernel:dotnet new console -o SemanticKernelThis creates a directory SemanticKernel with a basic console app. Add required NuGet packages:

dotnet add package Microsoft.SemanticKernel
dotnet add package Microsoft.SemanticKernel.Connectors.Ollama --prerelease
dotnet add package Microsoft.Extensions.Logging
dotnet add package Microsoft.Extensions.Logging.Console

  1. The logging packages (Microsoft.Extensions.Logging, Microsoft.Extensions.Logging.Console) let you observe request behavior, helping understand how Semantic Kernel processes interactions.
  2. Create the Product Plugin
    Create a file Plugins/ProductPlugin.cs to simulate a product table:
using Microsoft.SemanticKernel;
using System.ComponentModel;

namespace SemanticKernel.Plugins;

public class ProductPlugin
{
    private readonly List<Product> _products =
        [
            new (1, "Playstation 5", true, 10),
            new (2, "Mouse Gamer", true, 8),
            new (3, "Keyboard Gamer", true, 1),
            new (4, "Monitor", true, 0),
            new (5, "Desktop", false, 5)
        ];

    [KernelFunction("get_products")]
    [Description("Get all products")]
    public async Task<List<Product>> GetAllProductsAsync()
    {
        await Task.Delay(1);
        return _products;
    }

    [KernelFunction("get_state")]
    [Description("Get the state of a product")]
    public async Task<Product?> GetStateAsync([Description("The ID of the product")] int id)
    {
        await Task.Delay(1);
        return _products.FirstOrDefault(p => p.Id == id);
    }

    [KernelFunction("change_state")]
    [Description("Changes the state of a product")]
    public async Task<Product?> ChangeStateAsync([Description("The ID of the product")] int id,
                                                 [Description("The content of the product to be modified")] Product model)
    {
        await Task.Delay(1);
        var product = _products.FirstOrDefault(p => p.Id == id);

        if (product is null)
            return null;

        product = new Product(product.Id, model.Name, model.InStock, model.Quantity);
        return product;
    }
}

public record Product(int Id, string Name, bool InStock, int Quantity);

The ProductPlugin class simulates a product table using a Product record, with a list of products (e.g., “Playstation 5”). The methods GetAllProductsAsync, GetStateAsync, and ChangeStateAsync, decorated with KernelFunction, are exposed to the Semantic Kernel for use during AI interactions.

  1. Write the Code
    Replace Program.cs with:
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.Ollama;
using SemanticKernel.Plugins;

var builder = Kernel.CreateBuilder()
    .AddOllamaChatCompletion(
        modelId: "llama3.1:latest",
        endpoint: new Uri("http://localhost:11434")
        );

// Enterprise Components
builder.Services.AddLogging(x => x.AddConsole().SetMinimumLevel(LogLevel.Trace));

var app = builder.Build();

var chatCompletionService = app.GetRequiredService<IChatCompletionService>();

app.Plugins.AddFromType<ProductPlugin>("Plugins");

OllamaPromptExecutionSettings settings = new()
{
    FunctionChoiceBehavior = FunctionChoiceBehavior.Auto(),
};

// Add chat history
var history = new ChatHistory();

string? input;

do
{
    Console.Write("User > ");
    input = Console.ReadLine();

    history.AddUserMessage(input);

    var result = await chatCompletionService.GetChatMessageContentAsync(
        history, 
        executionSettings: settings,
        kernel: app
        );

    Console.WriteLine($"AI > {result}");

    history.AddMessage(result.Role, result.Content ?? string.Empty);
}
while (input is not null);

This code sets up a chat loop with Semantic Kernel, using llama3.1:latest and the ProductPlugin. The plugin allows the AI to fetch or update product data during chats (e.g., “List all products”). Logging helps observe request details.

  1. Run and Test
    Run the app with:
  1. dotnet runEnter prompts like “List all products” or “Is the Monitor in stock?” The AI uses the plugin to respond, cutting my data management time for AI Mind Center by 50%. Testers can validate outputs, while analysts can craft prompts.
  2. Optional Database Integration
    To manage real product data, connect to a database (e.g., SQL Server or PostgreSQL):
var connectionString = "your-database-connection-string";
using var conn = new SqlConnection(connectionString);
await conn.OpenAsync();
var cmd = new SqlCommand("SELECT Name, InStock, Quantity FROM Products WHERE Id = @Id", conn);
cmd.Parameters.AddWithValue("@Id", 1);
using var reader = await cmd.ExecuteReaderAsync();
if (reader.Read())
{
    var name = reader.GetString(0);
    var inStock = reader.GetBoolean(1);
    var quantity = reader.GetInt32(2);
    var prompt = $"Summarize product: {name}, InStock: {inStock}, Quantity: {quantity}";
    history.AddUserMessage(prompt);
}

This integrates database data into the chat loop.

Challenges and Solutions

Setting up Semantic Kernel had hurdles:

  • Plugin Complexity: Early plugins returned generic data. Solution: Use specific KernelFunction descriptions (e.g., “Get all products”).
  • Model Selection: llama3.1:latest balanced speed and quality, but larger models needed more memory. Solution: Stick to smaller models; 16GB RAM is ideal.
  • Logging Overhead: Excessive logs slowed debugging. Solution: Set LogLevel.Trace for detailed insights, adjustable for production.
  • Prompt Quality: Vague prompts led to irrelevant responses. Solution: Craft precise prompts (e.g., “List products in stock”), which analysts can refine.

Applications for Tech Professionals

This setup benefits various roles:

  • Developers: Build plugins for tasks like inventory management or content generation, integrating with AI.
  • Testers: Validate plugin outputs against expected data (e.g., product lists).
  • Business Analysts: Define prompts and plugins for workflows like report automation.

For AI Mind Center, I use plugins to manage blog data, saving hours. Developers can extend this to app features, testers for quality checks, and analysts for process automation.

Scaling Up

To enhance this:

  • Multiple Plugins: Add plugins for tasks like sentiment analysis.
  • Cloud AI: Integrate OpenAI or Azure via Semantic Kernel.
  • Monitoring: Use logging for performance tracking.

This approach streamlines AI Mind Center’s workflows and can boost any tech project.

Conclusion

Semantic Kernel, developed by Microsoft, simplifies AI orchestration for .NET developers, offering flexibility and power. For AI Mind Center, it’s transformed my data workflows, and for tech enthusiasts, it’s a gateway to smarter apps.

Felipe Machado

Felipe Machado

I'm truly excited about what AI has to offer—especially in how it can unlock our potential across every area of life. I dive deep into a variety of AI-related topics and share the most valuable insights and tools I've discovered that are helping me every day. That way, you don’t have to spend hours researching—I’ve done the hard work for you, so you can save time and focus on what matters most.

Related Posts

No Content Available

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

I agree to the Terms & Conditions and Privacy Policy.

Unlock Your Potential With AI | AI Mind Center

Unlock your potential with AI Mind Center! Explore AI tools, tutorials, and inspiration to grow, create, and geek out.

Follow Us

Subscribe to our newsletter!

Browse by Category

  • AI APIs & Libraries
  • AI Assisted Coding
  • AI for Developers
  • AI for NPCs & Game Characters
  • AI Game Design Tools
  • AI Game Optimization
  • AI Implementation Projects
  • AI in Game Development
  • AI Model Releases
  • AI News & Trends
  • AI Personal Assistants
  • AI Procedural Generation
  • AI Productivity Apps
  • AI Time Management
  • AI Tools for Productivity
  • AI Workflow Automation
  • Uncategorized

Recent News

Streamlining Workflows with Semantic Kernel

Streamlining Workflows with Semantic Kernel

September 26, 2025
Step-by-Step: Setting Up Microsoft.Extensions.AI

Step-by-Step: Setting Up Microsoft.Extensions.AI

September 25, 2025
Running IA Locally with Ollama with .NET

Running IA Locally with Ollama with .NET

September 24, 2025
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2025 | Website Made By aimindcenter.com.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • AI News & Trends
  • AI Tools for Productivity
  • AI in Game Development
  • AI for Developers
  • AI Tools Reviews

© 2025 | Website Made By aimindcenter.com.

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.