AF.AgentFramework
0.6.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package AF.AgentFramework --version 0.6.0
NuGet\Install-Package AF.AgentFramework -Version 0.6.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="AF.AgentFramework" Version="0.6.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AF.AgentFramework" Version="0.6.0" />
<PackageReference Include="AF.AgentFramework" />
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 AF.AgentFramework --version 0.6.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AF.AgentFramework, 0.6.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 AF.AgentFramework@0.6.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=AF.AgentFramework&version=0.6.0
#tool nuget:?package=AF.AgentFramework&version=0.6.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AF.AgentFramework
A minimal, extensible agent runtime for .NET:
Kernel, Engines, Runners, Hosting, and Policies.
- Deterministic: SingleActive per agent with ordered queues.
- Policy-driven: Admission, Ordering, Timeout, Retry, Preemption, Backpressure.
- Composable: Attach agents to engines with per-attachment overrides.
- Extensible: Plug your own engines/runners.
> Target framework: .NET 9.0
Install
dotnet add package AF.AgentFramework
Quick start
using System;
using System.Threading;
using System.Threading.Tasks;
using AgentFramework.Hosting;
using AgentFramework.Engines;
using AgentFramework.Runners.Timers;
using AgentFramework.Kernel;
using AgentFramework.Kernel.Policies.Defaults;
sealed class DummyAgent : IAgent
{
public string Id => "dummy";
public async Task HandleAsync(WorkItem item, IAgentContext ctx)
{
Console.WriteLine($"[Agent] {Id} handling {item.Kind} ({item.Id})");
await Task.Delay(100, ctx.Cancellation);
}
}
var host = AgentHostBuilder.Create()
.WithKernelDefaults(PolicySetDefaults.Create())
.AddEngine("loop", () => new LoopEngine("loop"))
.AddRunner("loop", () => new TimerRunner(TimeSpan.FromSeconds(1), "Loop Tick"))
.AddAgent("dummy", () => new DummyAgent())
.Attach("dummy", "loop")
.Build();
await host.StartAsync();
await Task.Delay(TimeSpan.FromSeconds(5));
await host.StopAsync();
Policies (defaults)
- Admission: accept unless queue is too long; reject late items.
- Ordering: priority first, then FIFO/deadline.
- Timeout: disabled by default (set via
TimeoutOptions). - Retry: exponential backoff; no retry on cancellations.
- Preemption: cooperative (opt-in).
- Backpressure: throttle/shed at high load.
Links
- Source & issues: https://github.com/runemalm/AF.AgentFramework
- API docs (DocFX): see the repository’s
docs/site
License
MIT © David Runemalm
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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.
-
net9.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.9)
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.16.0 | 127 | 11/1/2025 |
| 0.15.1 | 126 | 11/1/2025 |
| 0.15.0 | 172 | 10/26/2025 |
| 0.14.0 | 149 | 10/19/2025 |
| 0.13.0 | 92 | 10/18/2025 |
| 0.12.1 | 158 | 10/12/2025 |
| 0.12.0 | 163 | 10/12/2025 |
| 0.11.0 | 161 | 10/12/2025 |
| 0.10.0 | 116 | 10/11/2025 |
| 0.9.0 | 115 | 10/11/2025 |
| 0.8.0 | 108 | 10/11/2025 |
| 0.7.0 | 112 | 10/10/2025 |
| 0.6.0 | 170 | 10/1/2025 |
| 0.5.1 | 202 | 9/21/2025 |