SmooAI.SmoothOperator.Core 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SmooAI.SmoothOperator.Core --version 1.2.0
                    
NuGet\Install-Package SmooAI.SmoothOperator.Core -Version 1.2.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="SmooAI.SmoothOperator.Core" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SmooAI.SmoothOperator.Core" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="SmooAI.SmoothOperator.Core" />
                    
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 SmooAI.SmoothOperator.Core --version 1.2.0
                    
#r "nuget: SmooAI.SmoothOperator.Core, 1.2.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 SmooAI.SmoothOperator.Core@1.2.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=SmooAI.SmoothOperator.Core&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=SmooAI.SmoothOperator.Core&version=1.2.0
                    
Install as a Cake Tool

SmooAI.SmoothOperator.Core

The native C# implementation of the smooth-operator agent engine — an in-process, NuGet-installable sibling of the Rust reference engine smooai-smooth-operator-core. It is not a client to a remote server: it is the agent, running in your .NET process.

It's built on Microsoft.Extensions.AI and learns from Microsoft Agent Framework idioms, so it slots into the .NET AI ecosystem natively:

  • Any MEAI provider is the model (IChatClient — Azure OpenAI, OpenAI, Ollama, the smooth gateway, …).
  • A normal C# method is a tool (AIFunctionFactory.Create).
  • RunAsync / RunStreamingAsync (MAF naming).

Behavioral parity with the Rust reference is enforced by the shared conformance fixtures + eval scenarios, not by identical type shapes — see Polyglot Cores.

Status

  • Phase 0 — the agentic loop (shipped): IChatClient-driven loop, AIFunction tools, usage accumulation, max-iteration guard, streaming. MockChatClient test double.
  • Phase 1 — conversation + compaction (shipped): SmoothAgentThread for multi-turn history, MaxContextTokens budget + SlidingWindow compaction.
  • Phase 2 — memory + knowledge (shipped): pluggable IKnowledgeBase / IAgentMemory, retrieved and injected as pre-turn grounding context (RAG).
  • Phase 3 — checkpointing + resume (shipped): ICheckpointStore + CheckpointStrategy; snapshot a run and ResumeThreadAsync to rebuild a thread after a crash.
  • Phase 4 — HITL (shipped): IHumanGate pauses for human approval before sensitive/write tools (RequiresApproval); a denial is fed back to the model and the tool never runs.
  • Phase 5 — cast / subagents (shipped): a lead delegates to clearance-scoped sidekicks via the send_sidekick tool (Cast / OperatorRole / Clearance / SubagentDispatcher); isolated transcripts, only the summary returns.
  • Phase 6 — cost + budgets (shipped): CostTracker (token + USD via ModelPricing) and CostBudget that halts a run at a spend/token ceiling (AgentRunResponse.Cost / .BudgetExceeded).
  • Phase 7 — evals (shipped): the five shared scenarios run against the live gateway + an LLM judge (aggregate mean ≥ 4.0), gated on SMOOTH_AGENT_E2E=1 + SMOOAI_GATEWAY_KEY.

All phases shipped — 31 parity tests + 1 gated live-eval suite. See the phased roadmap in the Polyglot Cores doc.

// Multi-turn: pass a thread to each run and it remembers.
var thread = agent.GetNewThread();
await agent.RunAsync("My name is Brent.", thread);
var r = await agent.RunAsync("What's my name?", thread);   // "Your name is Brent."
// RAG: give it a knowledge base and it grounds answers in retrieved context.
var kb = new InMemoryKnowledgeBase();
await kb.IngestAsync(new KnowledgeDocument("returns", "The return window is 17 days.", "policy.md"));

var agent = new SmoothAgent(model, new AgentOptions { Knowledge = kb });
var r = await agent.RunAsync("How long is the return window?");   // grounded in policy.md

Quickstart

using Microsoft.Extensions.AI;
using SmooAI.SmoothOperator.Core;

// Any IChatClient — here, an OpenAI-compatible endpoint (the smooth gateway, Azure, …).
IChatClient model = /* your MEAI client */;

var options = new AgentOptions { Instructions = "You are a helpful support agent." };
options.Tools.Add(AIFunctionFactory.Create(
    (string city) => $"The weather in {city} is sunny.",
    "get_weather", "Gets the weather for a city"));

var agent = new SmoothAgent(model, options);

AgentRunResponse result = await agent.RunAsync("What's the weather in Chicago?");
Console.WriteLine(result.Text);          // final answer
Console.WriteLine(result.Iterations);    // LLM calls it took
Console.WriteLine(result.Usage.TotalTokenCount);

Stream it instead:

await foreach (var update in agent.RunStreamingAsync("What's the weather in Chicago?"))
    Console.Write(update.Text);

Build & test

dotnet test dotnet/core/tests/SmooAI.SmoothOperator.Core.Tests.csproj
# or the whole solution (client + core):
dotnet test dotnet/SmooAI.SmoothOperator.slnx

Relationship to SmooAI.SmoothOperator

SmooAI.SmoothOperator (in dotnet/src) is the protocol client — it talks to a remote Rust smooth-operator-server over WebSocket, and exposes an IChatClient facade. SmooAI.SmoothOperator.Core (here) is the engine — it runs the agent locally. They're complementary: use the client to reach a hosted agent, use the core to be the agent.

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
1.3.1 93 6/24/2026
1.3.0 242 6/24/2026
1.2.0 95 6/24/2026
1.1.0 98 6/24/2026
1.0.0 99 6/24/2026
0.9.0 99 6/23/2026
0.8.0 101 6/14/2026
0.7.0 98 6/14/2026
0.6.0 98 6/14/2026
0.5.0 114 6/13/2026
0.4.0 107 6/13/2026
0.3.0 98 6/13/2026
0.1.0 100 6/12/2026