DeepAgentNet.Tools
0.0.5-beta
This is a prerelease version of DeepAgentNet.Tools.
dotnet add package DeepAgentNet.Tools --version 0.0.5-beta
NuGet\Install-Package DeepAgentNet.Tools -Version 0.0.5-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.Tools" Version="0.0.5-beta" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DeepAgentNet.Tools" Version="0.0.5-beta" />
<PackageReference Include="DeepAgentNet.Tools" />
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.Tools --version 0.0.5-beta
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DeepAgentNet.Tools, 0.0.5-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.Tools@0.0.5-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.Tools&version=0.0.5-beta&prerelease
#tool nuget:?package=DeepAgentNet.Tools&version=0.0.5-beta&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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:
- Planning —
write_todosfor task breakdown and progress tracking - Filesystem —
read_file,write_file,edit_file,delete_file,ls,glob,grepfor sandboxed file access - Shell —
shellfor running commands with cross-platform shell detection - Sub-agents —
taskfor 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
This project is licensed under the terms of the MIT license
| Product | Versions 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.
-
net8.0
- CsvHelper (>= 33.0.1)
- DeepAgentNet (>= 0.0.5-beta)
- Microsoft.Agents.AI (>= 1.2.0)
- Polly (>= 8.6.6)
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.0.5-beta | 47 | 4/26/2026 |