DeepAgentNet 0.0.1-beta

This is a prerelease version of DeepAgentNet.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package DeepAgentNet --version 0.0.1-beta
                    
NuGet\Install-Package DeepAgentNet -Version 0.0.1-beta
                    
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="DeepAgentNet" Version="0.0.1-beta" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DeepAgentNet" Version="0.0.1-beta" />
                    
Directory.Packages.props
<PackageReference Include="DeepAgentNet" />
                    
Project file
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 DeepAgentNet --version 0.0.1-beta
                    
#r "nuget: DeepAgentNet, 0.0.1-beta"
                    
#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 DeepAgentNet@0.0.1-beta
                    
#: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=DeepAgentNet&version=0.0.1-beta&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DeepAgentNet&version=0.0.1-beta&prerelease
                    
Install as a Cake Tool

DeepAgentNet

The agent harness for .NET.

DeepAgentNet is an agent harness for .NET — a ready-to-run framework for building autonomous agents. Instead of wiring up prompts, tools, and context management yourself, you get a working agent out of the box and customize what you need.

Built on Microsoft Agent Framework and Microsoft.Extensions.AI.

What's included:

  • Planningwrite_todos for task breakdown and progress tracking
  • Filesystemread_file, write_file, edit_file, delete_file, ls, glob, grep for sandboxed file access
  • Shellshell for running commands with cross-platform shell detection
  • Sub-agentstask for delegating work with isolated context windows and session resume
  • Context management — chat history and compaction integrated at the chat client level for automatic context management during autonomous function calls
  • Tool approval — human-in-the-loop gates for sensitive operations

Quick Start

using DeepAgentNet.Agents;
using DeepAgentNet.FileSystems;
using DeepAgentNet.Shells;
using DeepAgentNet.SubAgents;
using DeepAgentNet.SubAgents.Contracts;
using DeepAgentNet.TodoLists;
using Microsoft.Agents.AI;
using Microsoft.Extensions.AI;

// 1. Create any IChatClient (Azure OpenAI, OpenAI, Ollama, etc.)
IChatClient chatClient = /* your chat client */;

// 2. Implement ISubAgentHandle to control sub-agent behavior
ISubAgentHandle subAgentHandle = new MySubAgentHandle();

// 3. Configure the agent harness
var options = DeepAgentOptionsBuilder.Create()
    .WithTodoList()
    .WithFileSystem(new FileSystemProviderOptions(
        new FileSystemAccess(new DirectoryInfo("./workspace"))))
    .WithShell(new ShellProviderOptions(new LocalShellResolver()))
    .WithSubAgent(new SubAgentProviderOptions
    {
        GeneralPurposeAgent = new GeneralPurposeAgentOptions(subAgentHandle)
    })
    .Build();

// 4. Build the agent
var agent = chatClient.AsDeepAgent(
    agentOptions: new ChatClientAgentOptions
    {
        ChatOptions = new ChatOptions
        {
            Instructions = "You are a helpful autonomous agent."
        }
    },
    deepAgentOptions: options);

// 5. Create a session and run
var session = await agent.CreateSessionAsync();
var inputs = new List<ChatMessage> { new(ChatRole.User, "Hello!") };

while (true)
{
    var updates = new List<AgentResponseUpdate>();

    await foreach (var update in agent.RunStreamingAsync(inputs, session))
    {
        Console.Write(update.Text);
        updates.Add(update);
    }

    var response = updates.ToAgentResponse();
    var approvals = response.Messages
        .SelectMany(m => m.Contents)
        .OfType<ToolApprovalRequestContent>()
        .ToList();

    // Handle tool approval requests from the master agent
    if (approvals.Count > 0)
    {
        var results = new List<AIContent>();
        foreach (var approval in approvals)
        {
            Console.Write($"\nApprove {approval.ToolCall}? (y/n): ");
            bool approved = Console.ReadLine()?.Trim().ToLower() == "y";
            results.Add(approval.CreateResponse(approved));
        }
        inputs = [new ChatMessage(ChatRole.Tool, results)];
        continue;
    }

    Console.Write("\nYou: ");
    var userInput = Console.ReadLine();
    if (string.IsNullOrEmpty(userInput)) break;
    inputs = [new ChatMessage(ChatRole.User, userInput)];
}

// ISubAgentHandle implementation
class MySubAgentHandle : ISubAgentHandle
{
    // Automatically approve all sub-agent tool calls for demo
    public Task<ToolApprovalResponseContent> ApproveToolCallAsync(
        string agentId, ToolApprovalRequestContent call, CancellationToken cancellationToken)
        => Task.FromResult(call.CreateResponse(approved: true));

    public Task<object?> ProvideFunctionResultAsync(
        string agentId, FunctionCallContent call, CancellationToken cancellationToken)
        => Task.FromResult<object?>(null);
}

License

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DeepAgentNet:

Package Downloads
DeepAgentNet.Tools

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.5-beta 53 4/26/2026
0.0.4-beta 52 4/19/2026
0.0.3-beta 55 4/19/2026
0.0.2-beta 52 4/18/2026
0.0.1-beta 63 4/16/2026