SmooAI.SmoothOperator.Core
0.6.0
See the version list below for details.
dotnet add package SmooAI.SmoothOperator.Core --version 0.6.0
NuGet\Install-Package SmooAI.SmoothOperator.Core -Version 0.6.0
<PackageReference Include="SmooAI.SmoothOperator.Core" Version="0.6.0" />
<PackageVersion Include="SmooAI.SmoothOperator.Core" Version="0.6.0" />
<PackageReference Include="SmooAI.SmoothOperator.Core" />
paket add SmooAI.SmoothOperator.Core --version 0.6.0
#r "nuget: SmooAI.SmoothOperator.Core, 0.6.0"
#:package SmooAI.SmoothOperator.Core@0.6.0
#addin nuget:?package=SmooAI.SmoothOperator.Core&version=0.6.0
#tool nuget:?package=SmooAI.SmoothOperator.Core&version=0.6.0
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,AIFunctiontools, usage accumulation, max-iteration guard, streaming.MockChatClienttest double. - Phase 1 — conversation + compaction (shipped):
SmoothAgentThreadfor multi-turn history,MaxContextTokensbudget +SlidingWindowcompaction. - 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 andResumeThreadAsyncto rebuild a thread after a crash. - Phase 4 — HITL (shipped):
IHumanGatepauses 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_sidekicktool (Cast/OperatorRole/Clearance/SubagentDispatcher); isolated transcripts, only the summary returns. - Phase 6 — cost + budgets (shipped):
CostTracker(token + USD viaModelPricing) andCostBudgetthat 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 | Versions 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. |
-
net8.0
- Microsoft.Extensions.AI.Abstractions (>= 9.7.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.