Skip to content

Minimal .NET 8 agent kernel with middleware pipeline and pluggable loop profiles (MAPE-K, reactive, and beyond).

License

Notifications You must be signed in to change notification settings

runemalm/AgentFramework.Kernel

Repository files navigation

AgentFramework.Kernel

NuGet version Build status License: MIT

AgentFramework.Kernel is a minimal .NET 8 library for building agents based on the MAPE-K loop and related control-loop architectures.

It provides:

  • A kernel that orchestrates agent execution.
  • A pluggable middleware pipeline.
  • Extensible loop profiles (e.g. MAPE-K, reactive loops).
  • Minimal abstractions to keep agents composable and testable.

📦 Installation

From NuGet:

dotnet add package AgentFramework.Kernel

🚀 Quick Start

Create a kernel, a profile, and run a tick:

using AgentFramework.Kernel;
using AgentFramework.Kernel.Abstractions;

var profile = new TestProfile(); // sample profile (see HelloKernel)
var kernel = new AgentKernel(profile, new IKernelMiddleware[]
{
    new LoggingMiddleware()
});

await kernel.StartAsync();
await kernel.TickAsync();
await kernel.StopAsync();

👉 See the HelloKernel sample for a runnable console app.


🧩 Key Concepts

Kernel

The AgentKernel is the control loop runner.
It starts, stops, and executes ticks, invoking each step defined by the active profile.

Profiles

A ILoopProfile defines the ordered steps an agent executes.
Examples:

  • MAPE-K (Monitor → Analyze → Plan → Execute → Knowledge update).
  • Reactive loop (Sense → Act).

Profiles are the extensibility point for experimenting with different agent families.

Middleware

Middleware implements IKernelMiddleware and runs before/after each step:

  • Tracing
  • Logging
  • Metrics
  • Policy enforcement

Context

KernelContext flows through the pipeline and provides:

  • The current StepId
  • Cancellation token
  • A scratchpad (Items) for cross-cutting state

🧪 Samples & Tests

Run tests:

make test

Run the sample:

make hello-kernel

🔄 Versioning & Releases

  • Versions are managed by semantic-release and git tags (vX.Y.Z).
  • Pre-1.0: breaking changes bump minor, not major (preMajor:true).
  • Package versions are injected at build time via MinVer.
  • See CHANGELOG.md for release history.

Dry-run a release locally:

make release-dry-run

🤝 Contributing

  1. Fork & clone
  2. Run make build / make test
  3. Add features with Conventional Commit messages (feat: ..., fix: ...)
  4. Open a PR

📄 License

MIT © David Runemalm

About

Minimal .NET 8 agent kernel with middleware pipeline and pluggable loop profiles (MAPE-K, reactive, and beyond).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •