DotAgents 1.0.0
The owner has unlisted this package.
This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package DotAgents --version 1.0.0
NuGet\Install-Package DotAgents -Version 1.0.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="DotAgents" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotAgents" Version="1.0.0" />
<PackageReference Include="DotAgents" />
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 DotAgents --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DotAgents, 1.0.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 DotAgents@1.0.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=DotAgents&version=1.0.0
#tool nuget:?package=DotAgents&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DotAgents
A simple and powerful Agent Development Kit for .NET - Similar to Google ADK but for the .NET ecosystem.
Features
- Simple API: Fluent builder pattern for creating agents
- Multi-Provider Support: OpenAI, Azure OpenAI, Anthropic, OpenRouter, Groq, Together, Mistral, DeepSeek, Ollama, and more
- Tool System: Easy-to-create tools with automatic schema generation
- Memory: Built-in memory support for conversations
- Streaming: Full streaming support for real-time responses
- Observability: Built-in tracing and logging
- Dependency Injection: First-class DI support
Installation
dotnet add package DotAgents
Quick Start
using DotAgents.Builder;
using DotAgents.Tools;
// Create a simple agent
var agent = AgentBuilder
.Create("my-agent")
.WithOpenAI("gpt-4o")
.WithInstructions("You are a helpful assistant.")
.WithTool<WeatherTool>()
.Build();
// Run the agent
var response = await agent.RunAsync("What's the weather in Tokyo?");
Console.WriteLine(response.Content);
Creating Tools
Using ToolBase
public class WeatherTool : ToolBase<WeatherInput>
{
public override string Name => "get_weather";
public override string Description => "Gets weather for a location.";
protected override async Task<ToolResult> ExecuteCoreAsync(
WeatherInput input,
CancellationToken cancellationToken)
{
var weather = await GetWeatherAsync(input.Location);
return ToolResult.Success(weather);
}
}
public class WeatherInput
{
public required string Location { get; init; }
}
Using Function Tools
var agent = AgentBuilder
.Create("agent")
.WithOpenAI()
.WithFunction<SearchInput, string>(
"search",
"Searches the web",
async (input, ct) => await SearchAsync(input.Query))
.Build();
Providers
OpenAI
.WithOpenAI("gpt-4o") // Uses OPENAI_API_KEY env var
.WithOpenAI("gpt-4o", "your-api-key")
Azure OpenAI
.WithAzureOpenAI(
endpoint: "https://your-resource.openai.azure.com",
deploymentName: "gpt-4o",
apiKey: "your-api-key") // or AZURE_OPENAI_API_KEY env var
Anthropic Claude
.WithAnthropic("claude-3-5-sonnet-20241022") // Uses ANTHROPIC_API_KEY env var
OpenRouter (Multi-Provider Gateway)
.WithOpenRouter("openai/gpt-4o") // Uses OPENROUTER_API_KEY env var
.WithOpenRouter("anthropic/claude-3.5-sonnet")
.WithOpenRouter("google/gemini-pro")
Groq (Fast Inference)
.WithGroq("llama-3.3-70b-versatile") // Uses GROQ_API_KEY env var
.WithGroq("mixtral-8x7b-32768")
Together AI
.WithTogether("meta-llama/Llama-3.3-70B-Instruct-Turbo") // Uses TOGETHER_API_KEY env var
Mistral AI
.WithMistral("mistral-large-latest") // Uses MISTRAL_API_KEY env var
DeepSeek
.WithDeepSeek("deepseek-chat") // Uses DEEPSEEK_API_KEY env var
Ollama (Local)
.WithOllama("llama3.2") // No API key needed
.WithOllama("llama3.2", "http://localhost:11434/v1")
LM Studio (Local)
.WithLMStudio("local-model") // No API key needed
Provider via Enum
.WithProvider(ModelProvider.Groq, "llama-3.3-70b-versatile")
.WithProvider(ModelProvider.OpenRouter, "google/gemini-pro")
Provider via Environment Variables
export DOTAGENTS_PROVIDER=OpenRouter
export DOTAGENTS_MODEL=openai/gpt-4o
export OPENROUTER_API_KEY=your-key
var agent = AgentBuilder
.Create("agent")
.WithProviderFromEnv() // Reads from DOTAGENTS_PROVIDER, DOTAGENTS_MODEL
.Build();
Custom OpenAI-Compatible API
.WithOpenAICompatible(
baseUrl: "https://your-api.com/v1",
modelId: "your-model",
apiKey: "your-key")
Memory
// Enable in-memory storage
var agent = AgentBuilder
.Create("agent")
.WithOpenAI()
.WithMemory()
.Build();
// Continue conversation
var response1 = await agent.RunAsync("My name is Carlos");
var response2 = await agent.ContinueAsync(
"What's my name?",
response1.ConversationId);
Streaming
await foreach (var chunk in agent.RunStreamingAsync("Tell me a story"))
{
if (chunk.Content is not null)
{
Console.Write(chunk.Content);
}
}
Dependency Injection
services.AddDotAgents(options =>
{
options.EnableTracing = true;
options.EnableMemory = true;
});
services.AddAgent("weather-agent", builder => builder
.WithOpenAI()
.WithTool<WeatherTool>());
Architecture
DotAgents
├── Core # IAgent, AgentContext, AgentResponse
├── Builder # AgentBuilder, AgentOptions
├── Tools # ITool, ToolBase, ToolExecutor
├── Memory # IMemoryStore, InMemoryStore
├── Planning # IPlanner, DefaultPlanner
├── Runtime # AgentLoop
├── Providers # IChatModel, OpenAI, Azure, Anthropic
└── Observability # IAgentTracer, ConsoleTracer
License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
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 |
|---|