SharpAIKit 0.3.0

dotnet add package SharpAIKit --version 0.3.0
                    
NuGet\Install-Package SharpAIKit -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SharpAIKit" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpAIKit" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="SharpAIKit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SharpAIKit --version 0.3.0
                    
#r "nuget: SharpAIKit, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SharpAIKit@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SharpAIKit&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=SharpAIKit&version=0.3.0
                    
Install as a Cake Tool

SharpAIKit

A unified .NET large-model application and agentic AI development framework.

Overview

SharpAIKit is a comprehensive AI/LLM toolkit for .NET that provides a unified interface for working with large language models, building AI agents, and implementing RAG (Retrieval-Augmented Generation) applications. It's designed to be more powerful and simpler than LangChain, with killer features that leverage the .NET ecosystem.

Key Features

Core Capabilities

  • Unified LLM Interface - One API for all OpenAI-compatible models
  • LCEL-style Chains - Elegant chain composition with pipe operators
  • Multiple Memory Strategies - Buffer, Window, Summary, Vector, and Entity memory
  • Advanced Agents - ReAct, Plan-and-Execute, and Multi-Agent systems
  • RAG Engine - Built-in document indexing and intelligent Q&A
  • Full Observability - Console, logging, metrics, and file tracing

Killer Features Beyond LangChain

  • 🔮 Native C# Code Interpreter - Execute C# code directly using Roslyn, no Python needed
  • 🕸️ SharpGraph - Graph-based orchestration with FSM, supports loops and complex branches
  • 🧬 DSPy-style Optimizer - Automatically optimize prompts through iterative improvement

Installation

dotnet add package SharpAIKit

Quick Start

using SharpAIKit.LLM;

// Create a client for any OpenAI-compatible API
var client = LLMClientFactory.Create(
    apiKey: "your-api-key",
    baseUrl: "https://api.deepseek.com/v1",
    model: "deepseek-chat"
);

// Simple chat
var response = await client.ChatAsync("Hello!");
Console.WriteLine(response);

// Streaming output
await foreach (var chunk in client.ChatStreamAsync("Tell me a story"))
{
    Console.Write(chunk);
}

Supported LLM Providers

SharpAIKit supports all OpenAI-compatible APIs, including:

  • OpenAI
  • DeepSeek
  • Qwen (Alibaba)
  • Mistral
  • Yi (01.AI)
  • Groq
  • Moonshot (Kimi)
  • Zhipu GLM
  • Ollama (Local)
  • Any custom OpenAI-compatible endpoint

Example: Code Interpreter

using SharpAIKit.CodeInterpreter;

var interpreter = new RoslynCodeInterpreter();
var result = await interpreter.ExecuteAsync<double>("Math.Pow(3, 5)");
Console.WriteLine($"3^5 = {result}");  // Output: 243

Example: Graph Orchestration

using SharpAIKit.Graph;

var graph = new SharpGraphBuilder("start")
    .Node("start", async state => {
        state.NextNode = "process";
        return state;
    })
    .Node("process", async state => {
        state.Output = "Done";
        state.ShouldEnd = true;
        return state;
    })
    .Build();

var result = await graph.ExecuteAsync();

Example: Prompt Optimization

using SharpAIKit.Optimizer;

var optimizer = new DSPyOptimizer(client)
    .AddExample("What is C#?", "C# is an object-oriented programming language...")
    .SetMetric(Metrics.Contains);

var result = await optimizer.OptimizeAsync("Answer: {input}");
Console.WriteLine(result.OptimizedPrompt);

Documentation

For detailed documentation and examples, visit:

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 107 12/25/2025
0.2.0 113 12/25/2025
0.1.0 183 12/4/2025