Glacier.AgentDevKit.Adk 1.1.0

dotnet add package Glacier.AgentDevKit.Adk --version 1.1.0
                    
NuGet\Install-Package Glacier.AgentDevKit.Adk -Version 1.1.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="Glacier.AgentDevKit.Adk" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Glacier.AgentDevKit.Adk" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Glacier.AgentDevKit.Adk" />
                    
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 Glacier.AgentDevKit.Adk --version 1.1.0
                    
#r "nuget: Glacier.AgentDevKit.Adk, 1.1.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 Glacier.AgentDevKit.Adk@1.1.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=Glacier.AgentDevKit.Adk&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Glacier.AgentDevKit.Adk&version=1.1.0
                    
Install as a Cake Tool

Agent Development Kit (ADK)

DEV.to Story NuGet Website Buy Me A Coffee

📖 Read the Deep-Dive: C# got left behind in the AI Agent hype. So I fixed it. (AgentDevKit)

Welcome to Glacier.AgentDevKit.Adk — a 100% pure C# (.NET 10), Native AOT-compatible library for building autonomous AI agents that think, plan, stream, and act using strongly typed C# tools, multi-agent workflows, and the Model Context Protocol (MCP).


Key Capabilities

  • 100% Pure C# & Native AOT Compatible (net10.0): Zero Python bridges, zero native SQLite dependencies, and full JsonTypeInfo<T> + JsonSchemaExporter support.
  • Dynamic Tool Schema Generation: FunctionTool<TArgs, TResult> automatically derives accurate JSON Schemas (including [Description] attributes and required properties) directly from your TArgs DTOs.
  • True Incremental SSE Streaming: Real-time token streaming and multi-chunk SSE tool-call delta reassembly across both OpenAiService (OpenAI, Glacier.Serve, vLLM, Ollama) and GeminiService (?alt=sse with x-goog-api-key header auth).
  • Fail-Closed Security & Guardrails: SensitiveTool enforces mandatory IApprovalService human-in-the-loop (HITL) consent (denying execution automatically if unconfigured), paired with BeforeToolCall argument interceptors.
  • Composable Multi-Agent Orchestration: Built-in DelegationTool, SequentialAgent, ParallelAgent, and LoopAgent primitives.
  • Native OpenTelemetry: First-class ActivitySource traces and Meter counters (Glacier.AgentDevKit.Adk).

Getting Started

Agent Architecture

using System.ComponentModel;
using Glacier.AgentDevKit.Adk;

// 1. Connect an LLM provider (Gemini or any OpenAI-compatible server)
var llm = new GeminiService(Environment.GetEnvironmentVariable("GEMINI_API_KEY")!);

// 2. Define a strongly typed C# tool (JSON Schema is generated automatically from WeatherArgs)
var weatherTool = new FunctionTool<WeatherArgs, string>(
    name: "get_weather",
    description: "Gets the current weather for a city.",
    execute: args => $"Sunny and 22C in {args.City} ({args.Units})"
);

// 3. Create your Agent
var agent = new LlmAgent(
    name: "TravelAssistant",
    model: "gemini-2.5-flash",
    description: "Helps travellers plan trips.",
    instruction: "You are a concise travel assistant. Use tools when needed.",
    tools: new List<ITool> { weatherTool }
);

// 4. Run or stream responses
string answer = await agent.RunAsync("What's the weather in Tokyo in metric?", llm);

public sealed class WeatherArgs
{
    [Description("City name, e.g. Tokyo")]
    public required string City { get; set; }

    [Description("Temperature unit system (metric or imperial)")]
    public string Units { get; set; } = "metric";
}

Session Memory (MemorySessionProvider & FileSessionProvider)

Give agents persistent multi-turn memory across requests or process restarts without any native C/C++ database libraries:

var sessions = new FileSessionProvider("./agent_sessions");

var agent = new LlmAgent(
    name: "Concierge",
    model: "gpt-4o-mini",
    description: "Remembers user preferences.",
    instruction: "Remember facts shared by the user.",
    tools: new List<ITool>(),
    sessionProvider: sessions
);

await agent.RunAsync("My favourite airline seat is aisle.", llm, sessionId: "user-42");

await foreach (var token in agent.RunStreamingAsync("Which seat should I book?", llm, sessionId: "user-42"))
{
    Console.Write(token);
}

Multi-Agent Teams & Workflows

Manager-Worker Delegation

Delegation Pattern

var researcher = new LlmAgent("Researcher", "gemini-2.5-flash", "Finds domain facts.", "Provide verified facts.");
var manager = new LlmAgent(
    "Manager",
    "gemini-2.5-flash",
    "Coordinates tasks.",
    "Delegate research questions to Researcher and summarize.",
    new List<ITool> { new DelegationTool(researcher, llm) }
);

Orchestration Workflows

  • SequentialAgent: Pipes the output of step i into step i + 1. Sequential Pipeline
  • ParallelAgent: Executes multiple specialist agents concurrently via Task.WhenAll, with an optional consolidator agent. Parallel Workflow
  • LoopAgent: Iteratively refines output until a stopCondition predicate succeeds or maxTurns is reached. Loop Workflow

Model Context Protocol (MCP)

Discover and invoke external MCP servers natively via Glacier.Agent.Mcp:

await using var mcp = new McpService();
var mcpTools = await mcp.InitializeFromConfigAsync(configuration);
agent.Tools.AddRange(mcpTools);

Security: Guardrails & Fail-Closed HITL Approvals

Wrapping a tool in SensitiveTool guarantees fail-closed enforcement: if ApprovalService is missing or returns false, execution is blocked before the tool can run.

var deleteTool = new SensitiveTool(new DeleteDatabaseTool());

var agent = new LlmAgent("OpsAgent", "gpt-4o-mini", "Ops assistant", "Manage databases safely.", new List<ITool> { deleteTool })
{
    ApprovalService = new ConsoleApprovalService(),
    BeforeToolCall = (tool, argsJson) =>
    {
        if (argsJson.Contains("..", StringComparison.Ordinal))
        {
            throw new InvalidOperationException("Path traversal blocked.");
        }
        return Task.FromResult(argsJson);
    }
};

Resilience & Self-Correction

Self-Correction Loop

When local or quantized models emit noisy JSON around tool arguments, OpenAiService extracts valid JSON blocks and LlmAgent feeds validation errors back to the model for automatic self-correction up to MaxRetries.


What's New in v1.1.0

  • Dynamic JSON Schema Generation (FunctionTool): Replaced static placeholder schemas with .NET 10 JsonSchemaExporter ([Description], required, and Native AOT JsonTypeInfo<T> overloads).
  • Streaming SSE Tool-Call Reassembly & True Gemini SSE: OpenAiService reassembles chunked SSE delta.tool_calls fragments and correlates tool_call_ids; GeminiService streams real incremental SSE (?alt=sse + x-goog-api-key header).
  • Fail-Closed SensitiveTool Enforcement: LlmAgent strictly blocks SensitiveTool execution whenever no IApprovalService is configured.
  • Full Native AOT Compatibility (<IsAotCompatible>true</IsAotCompatible>): Source-generated AdkJsonContext, AOT-safe MCP configuration binding, and zero build/trim warnings under <TreatWarningsAsErrors>true</TreatWarningsAsErrors>.

Credits

Developed by Ian Cowley and Antigravity (Google DeepMind).


❄️ Glacier Ecosystem & Support

Part of the Glacier Ecosystem — high-performance, zero-allocation developer tooling and data engines natively built for modern C# and .NET 10.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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
1.1.0 73 11/1/2026
1.0.5 160 9/30/2026
1.0.4 133 9/18/2026
1.0.3 134 9/8/2026
1.0.2 206 5/20/2026
1.0.1 135 5/14/2026