ℹ️ This repository hosts the ManagedCode-maintained C# 13 / .NET 9 port of Microsoft’s Agent Lightning project.
The original Python implementation remains the functional reference and is mirrored underexternal/microsoft-agent-lightningas a read-only git submodule. All active development happens in theManagedCode.AgentLightning.*C# projects.
ManagedCode Agent Lightning brings Microsoft’s reinforcement-learning toolkit for AI agents to .NET.
The port mirrors the behaviour of the upstream Python implementation while taking advantage of Microsoft.Extensions.AI, the generic host, and modern C# features.
No Python code is executed within this solution; the Python sources live purely for reference and parity validation.
| Path | Description |
|---|---|
src/ManagedCode.AgentLightning.Core |
Core domain models (Rollout, Attempt, hooks, metadata primitives). |
src/ManagedCode.AgentLightning.AgentRuntime |
Execution pipeline built around IChatClient and dependency injection helpers. |
tests/ManagedCode.AgentLightning.Tests |
xUnit tests for the C# implementation (no Python dependencies). |
external/microsoft-agent-lightning |
Upstream Python repository (git submodule, kept read-only). |
MIGRATION_PLAN.md |
Module-by-module parity tracker for the migration process. |
AGENTS.md |
Working agreements and guardrails specific to this port. |
- .NET SDK 9.0.300 or later (C# 13 preview enabled).
- Git with submodule support if you want to inspect the upstream Python sources.
git clone https://github.com/managedcode/agent-lightning.git
cd agent-lightning
git submodule update --init --recursive # optional – only if you need to inspect the Python reference
dotnet restore
dotnet format
dotnet test- ✔ Core rollout/attempt models ported to C# with parity-focused semantics.
- ✔ Initial agent runtime executing rollouts against any
IChatClient(service-host ready). - ✔ CI, CodeQL, and release workflows based entirely on .NET tooling.
- 🛠 Migration progress tracked in
MIGRATION_PLAN.md. - 🗺 Upcoming work: tracer/span parity, runner orchestration, real AI provider adapters.
- Fork the repository and branch from
main. - Run
dotnet formatfollowed bydotnet testbefore submitting changes. - Update
MIGRATION_PLAN.mdwith any new parity milestones or design decisions. - Submit a pull request describing the ported functionality and tests.
This project is licensed under the MIT License.