Standard.Agents
0.10.0
dotnet add package Standard.Agents --version 0.10.0
NuGet\Install-Package Standard.Agents -Version 0.10.0
<PackageReference Include="Standard.Agents" Version="0.10.0" />
<PackageVersion Include="Standard.Agents" Version="0.10.0" />
<PackageReference Include="Standard.Agents" />
paket add Standard.Agents --version 0.10.0
#r "nuget: Standard.Agents, 0.10.0"
#:package Standard.Agents@0.10.0
#addin nuget:?package=Standard.Agents&version=0.10.0
#tool nuget:?package=Standard.Agents&version=0.10.0

<div align="center">
The Standard AI Agent Framework
Agent = Orchestration(Data, Decision, Direction)
The C# reference implementation of The Standard for Agents.
</div>
The mark is the thing itself: three arcs — Data, Decision, Direction — orbiting a single core. One brain at the center, the three natures turning around it.
- Data — what the agent has (skills, memory, knowledge) · verb: Recall
- Decision — what the agent thinks (one brain, wrapped in a Gate and a Judge) · verb: Think
- Direction — what the agent does (act internally, act externally, or return) · verb: Act
Orchestration is not a fourth nature. It is the composition operator — the loop.
Watch
Install
dotnet add package Standard.Agents
The bare minimum is a brain — nothing else required:
var agent = new StandardAgent(apiUrl: "https://api.peerllm.com/v1/", apiKey: key, model: "LLooMA2.0");
string answer = await agent.ProcessPromptAsync("What is 47 * 89?");
Add skills, tools, and guardians as you grow. Skills and tools are picked up when present; the Gate and Judge are opt-in (SPEC.md §8.1 — the Core profile may leave them pass-through):
var agent = new StandardAgent()
.Brain(apiUrl: "https://api.peerllm.com/v1/", apiKey: key, model: "LLooMA2.0")
.Skills("Skills")
.Tool(new CalculatorTool())
.Gate(apiUrl: "https://api.peerllm.com/v1/", apiKey: key, model: "LLooMA2.0")
.LogTo("log.txt");
Stream the agent thinking and answering — each event is tagged, and the answer arrives live:
await foreach (AgentStreamEvent streamEvent in agent.StreamPromptAsync("What is 47 * 89?"))
{
switch (streamEvent.Type)
{
case AgentStreamEventType.Thinking: /* the model deliberating / tool reasoning */ break;
case AgentStreamEventType.Response: /* the answer, token by token */ break;
case AgentStreamEventType.Tool: /* a tool ran, and its result */ break;
case AgentStreamEventType.Status: /* lifecycle: turns, gate, judge */ break;
}
}
No DI container. Compose() hand-wires the whole graph — SPEC.md §9: "DI is OPTIONAL. A
hand-wired composition root is fully conformant."
New here? docs/how-to.md walks from a one-line talking agent to skills, tools, guardians, memory, knowledge, and every backend below — one capability at a time, every snippet runnable.
Backends — every nature is swappable
The core ships dependency-free defaults: a hosted brain, file memory, file knowledge. Swap any nature for a real backend with one line — same seam, the dependency living in an opt-in package.
| Nature | Default (in core) | Swap to | Package |
|---|---|---|---|
| Brain · Decision | hosted .Brain(url,…) |
local GGUF (llama.cpp) | …Decision.Brains.LlamaSharp |
| Gate / Judge · Decision | hosted .Gate / .Judge |
in-process | core — .LocalGate / .LocalJudge |
| Memory · Data | file | Redis | …Data.Memory.Redis |
| Knowledge · Data | folder | PostgreSQL full-text | …Data.Knowledge.Postgres |
| Knowledge · Data | folder | SQL Server full-text | …Data.Knowledge.MsSql |
// fully local — one GGUF drives brain, gate and judge, no network anywhere
var llama = new LlamaSharpGeneratorBroker("model.gguf");
var agent = new StandardAgent()
.UseGenerator(llama)
.LocalGate(llama.GenerateAsync)
.LocalJudge(llama.GenerateAsync);
// production data — full-text knowledge in Postgres, shared memory in Redis
var agent = new StandardAgent(url, key, "LLooMA2.0")
.UseKnowledgePostgres(pgConnectionString)
.UseMemoryRedis("localhost:6379", key: $"agent:{userId}");
Pick each nature's home independently; the code above doesn't change when you do.
The 1·3·9

| Tier | Count | Members |
|---|---|---|
| Coordination | 1 | AgentCoordinationService — the only loop: Recall → Think → Act |
| Orchestration | 3 | Data · Decision · Direction |
| Foundation | 9 | Skills, Memory, Knowledge / Gate, Brain, Judge / Internal, External, Return |
| Broker | 8+2 | one liaison per resource, plus logging |
Nine foundations, eight nature brokers: ReturnService has no broker. It is the dead end — the
terminal Direction hands the result back and touches nothing.
Flow is forward only. A tier never calls the tier above it.
Governance
Two rulebooks, and they compose:
- SPEC.md owns contracts and behavior. Normative, language-neutral.
- The Standard owns structure, exceptions,
and process — brokers, foundations, orchestrations, the
Xeptionmodel, FAIL/PASS TDD.
They do not collide: SPEC.md §1 states that "conformance is about contracts and behavior, not file layout or language idiom."
The theory is settled in THE-TRI-NATURE-OF-AGENT.md before any code is written. Build to it.
Structure
Standard.Agents/ the library
|-- Brokers/{Data,Decision,Direction,Loggings}
|-- Models/Foundations/{Entity}/Exceptions
|-- Models/Orchestrations/Agents AgentContext, AgentStatus
|-- Services/{Foundations,Orchestrations,Coordinations}
|-- Tools/ ITool, AgentTool — the fractal bridge
Standard.Agents.Tests.Unit/ unit tests, mirroring the service tree
Standard.Agents.Conformance/ the vector runner
Standard.Agents.Demo/ a console agent you can run
conformance/ language-neutral behavioral vectors
Conformance
Agent behavior involves an LLM and is non-deterministic, so it cannot be asserted directly.
conformance/ instead pins the deterministic contracts — the
loop, reply interpretation, tool routing, and the feed-back of results into Data — by scripting
the Brain. Every double replaces a broker, never a service: the whole 1·3·9 under test is the
real library.
dotnet test # unit tests
dotnet run --project Standard.Agents.Conformance # spec certification; exit 0 = conformant
A Core implementation is a minimal viable agent. A Full implementation adds real memory, knowledge, guardian gate/judge, and external tools.
The fractal
An agent satisfies ITool, so an agent can be a tool of another agent. Theory Ch.4 — turtles up:
var researcher = new AgentTool("researcher", innerAgent);
var outerAgent = new StandardAgent().Brain(...).Tool(researcher);
Nesting needs no new machinery because the shapes already agree. It is also how a guardian scales: a compliance sub-agent is a distinct conscience, rather than the same brain grading itself.
Contributing
This repo follows The Standard's practices:
- One issue per method. One branch per issue.
- Branch:
users/[username]/[CATEGORY]-[entity]-[action], where the action speaks the language of its layer — brokersinsert/select, foundationsadd/retrieve. - Foundations and up are test-driven, two commits per test:
[TestName] -> FAIL, then[TestName] -> PASS. A FAIL commit must have been run and observed failing. - Brokers carry no unit tests — they are thin and hold no logic. Commit as
BROKERS: [Description]. - PR title:
[CATEGORY]: [Description Of Work Completed].
License
| Product | Versions 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. |
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- RESTFulSense (>= 3.2.0)
- Xeption (>= 2.9.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Standard.Agents:
| Package | Downloads |
|---|---|
|
Standard.Agents.Data.Knowledge.MsSql
A SQL Server knowledge source (the Data nature) for Standard.Agents. Grounds an agent on a SQL Server table using full-text search — the same IKnowledgeBroker seam as the built-in file knowledge, swapped in with .UseKnowledgeMsSql(...). The core Standard.Agents package stays dependency-free; this package brings Microsoft.Data.SqlClient. |
|
|
Standard.Agents.Data.Knowledge.Postgres
A PostgreSQL knowledge source (the Data nature) for Standard.Agents. Grounds an agent on a Postgres table using full-text search — the same IKnowledgeBroker seam as the built-in file knowledge, swapped in with .UseKnowledgePostgres(...). The core Standard.Agents package stays dependency-free; this package brings Npgsql. |
|
|
Standard.Agents.Data.Memory.Redis
A Redis memory store (the Data nature) for Standard.Agents. Persists an agent's memory as a Redis list keyed per agent/user/session — the same IMemoryBroker seam as the built-in file memory, swapped in with .UseMemoryRedis(...). The core Standard.Agents package stays dependency-free; this package brings StackExchange.Redis. |
|
|
Standard.Agents.Decision.Brains.LlamaSharp
An optional in-process local-inference brain (the Decision nature) for Standard.Agents, backed by LLamaSharp (llama.cpp). Runs GGUF models locally with no HTTP and no API key. The core Standard.Agents package stays dependency-free; add a LLamaSharp backend package (LLamaSharp.Backend.Cpu, .Cuda12, .Vulkan, …) to run. |
GitHub repositories
This package is not used by any popular GitHub repositories.