![]() |
VOOZH | about |
dotnet add package AgentSdk --version 1.4.0
NuGet\Install-Package AgentSdk -Version 1.4.0
<PackageReference Include="AgentSdk" Version="1.4.0" />
<PackageVersion Include="AgentSdk" Version="1.4.0" />Directory.Packages.props
<PackageReference Include="AgentSdk" />Project file
paket add AgentSdk --version 1.4.0
#r "nuget: AgentSdk, 1.4.0"
#:package AgentSdk@1.4.0
#addin nuget:?package=AgentSdk&version=1.4.0Install as a Cake Addin
#tool nuget:?package=AgentSdk&version=1.4.0Install as a Cake Tool
👁 NuGet Version
👁 NuGet Downloads
👁 Build Status
👁 License: MIT
👁 .NET
A .NET SDK for building AI agent workflows using Microsoft Agent Framework (MAF) and Azure AI Foundry. Provides workflow orchestration, agent factories, vector store management, and OpenTelemetry integration.
For PDF processing features, see .
Executor<TInput, TOutput> patternfile_search and/or code_interpreter via YAML configurationFor PDF processing features (image extraction, content analysis, markdown conversion), see .
dotnet add package AgentSdk
# For PDF processing features
dotnet add package AgentSdk.Pdf
Sessions maintain conversation context and state across multiple agent invocations. Each session is created per agent and managed throughout the workflow:
CreateAgentAsync() is calledRunAgentWithPollingAsync() callsCleanupAsync() is called (if auto_delete is true)using Cyclotron.Maf.AgentSdk.Agents;
using Cyclotron.Maf.AgentSdk.Services;
using Microsoft.Extensions.DependencyInjection;
var builder = Host.CreateApplicationBuilder(args);
// Load agent configuration from agent.config.yaml and .env files
builder.UseAgentSdk();
// Register core services
builder.Services.AddAgentSdkServices();
// Add telemetry (optional)
builder.AddAgentSdkTelemetry();
Create agent.config.yaml in your project:
# Model Provider Configuration
providers:
azure_foundry:
type: "azure_foundry"
endpoint: "${PROJECT_ENDPOINT}" # Environment variable substitution
deployment_name: "${PROJECT_DEPLOYMENT_NAME}"
api_version: "2024-12-01-preview"
timeout_seconds: 300
max_retries: 3
# Agent Configuration
agents:
my_agent:
type: "custom"
enabled: true
auto_delete: true # Delete agent after workflow completes
auto_cleanup_resources: true # Delete vector store after workflow completes
metadata:
description: "Document processing agent"
tools: # Configure which tools the agent can use
- "file_search" # Enable document search in vector stores
- "code_interpreter" # Enable Python code execution (optional)
provider: "azure_foundry" # Reference to providers section
system_prompt_template: |
You are a helpful assistant specialized in document analysis.
user_prompt_template: |
Process the document: {{fileName}}
Context: {{context}}
Create a .env file in your project root:
PROJECT_ENDPOINT=https://your-project.api.azureml.ms
PROJECT_DEPLOYMENT_NAME=gpt-4o
using Cyclotron.Maf.AgentSdk.Agents;
using Microsoft.Agents.AI.Workflows.Executors;
using Microsoft.Extensions.DependencyInjection;
public class MyProcessingExecutor : Executor<InputType, OutputType>
{
private readonly IAgentFactory _agentFactory;
public MyProcessingExecutor(
[FromKeyedServices("my_agent")] IAgentFactory agentFactory)
{
_agentFactory = agentFactory;
}
public override async ValueTask<OutputType> HandleAsync(
InputType input,
IWorkflowContext context,
CancellationToken cancellationToken = default)
{
// Create agent with vector store
await _agentFactory.CreateAgentAsync(vectorStoreId, cancellationToken);
try
{
// Run agent with automatic retry and polling
var response = await _agentFactory.RunAgentWithPollingAsync(
messages: [_agentFactory.CreateUserMessage(promptContext)],
cancellationToken: cancellationToken);
// Process response...
return result;
}
finally
{
// Cleanup respects auto_delete and auto_cleanup_resources settings
// This deletes the agent, session, and optionally the vector store
await _agentFactory.CleanupAsync(cancellationToken);
}
}
}
using Microsoft.Agents.AI.Workflows;
var workflow = new WorkflowBuilder(executor1)
.AddEdge(executor1, executor2)
.AddEdge(executor2, executor3)
.WithOutputFrom(executor3)
.Build();
var result = await workflow.ExecuteAsync<OutputType>(input, cancellationToken);
agent.config.yaml)| Property | Type | Description | Default |
|---|---|---|---|
type |
string | Provider type (azure_foundry) |
Required |
endpoint |
string | Azure AI Foundry endpoint URL | Required |
deployment_name |
string | Model deployment name | Required |
model |
string | Alternative to deployment_name | - |
api_version |
string | API version | 2024-12-01-preview |
timeout_seconds |
int | Request timeout | 300 |
max_retries |
int | Maximum retry attempts | 3 |
temperature |
float | Sampling temperature (0.0-2.0) | - |
top_p |
float | Nucleus sampling (0.0-1.0) | - |
| Property | Type | Description | Default |
|---|---|---|---|
type |
string | Agent type identifier | Required |
enabled |
bool | Whether agent is active | true |
auto_delete |
bool | Delete agent and session after use | true |
auto_cleanup_resources |
bool | Delete vector store after use | false |
system_prompt_template |
string | Handlebars template for system prompt | - |
user_prompt_template |
string | Handlebars template for user prompt | - |
temperature |
float | Overrides provider temperature (0.0-2.0) | - |
top_p |
float | Overrides provider Top P (0.0-1.0) | - |
| Property | Type | Description | Default |
|---|---|---|---|
description |
string | Human-readable description | "" |
tools |
string[] | Tools to enable: file_search, code_interpreter |
[] |
Note: If no tools are configured,
file_searchis enabled by default when creating an agent with a vector store.
| Property | Type | Description | Default |
|---|---|---|---|
provider |
string | Reference to a provider in the providers section |
Required |
Values in agent.config.yaml support ${VAR_NAME} syntax for environment variable substitution:
endpoint: "${PROJECT_ENDPOINT}" # Reads PROJECT_ENDPOINT from environment
deployment_name: "${PROJECT_DEPLOYMENT_NAME}"
appsettings.json){
"Telemetry": {
"Enabled": true,
"SourceName": "MyAgentService",
"EnableSensitiveData": false,
"OtlpEndpoint": "http://localhost:4318"
}
}
{
"VectorStoreIndexing": {
"MaxWaitAttempts": 60,
"InitialWaitDelayMs": 2000,
"UseExponentialBackoff": true,
"MaxWaitDelayMs": 30000,
"TotalTimeoutMs": 0
}
}
For PDF-related configuration options, see .
| Namespace | Description |
|---|---|
Cyclotron.Maf.AgentSdk |
Root namespace |
Cyclotron.Maf.AgentSdk.Agents |
Agent factory and related types |
Cyclotron.Maf.AgentSdk.Models |
Data models and DTOs |
Cyclotron.Maf.AgentSdk.Models.Workflow |
Workflow-specific models |
Cyclotron.Maf.AgentSdk.Options |
Configuration options classes |
Cyclotron.Maf.AgentSdk.Services |
Service interfaces |
Cyclotron.Maf.AgentSdk.Services.Impl |
Service implementations |
Cyclotron.Maf.AgentSdk.Workflows |
Workflow executors |
| Interface | Description |
|---|---|
IAgentFactory |
Creates and manages Azure AI Foundry agents |
IVectorStoreManager |
Manages vector store lifecycle |
IPromptRenderingService |
Renders Handlebars templates |
IProviderClientFactory |
Creates AI provider clients (Azure, Ollama) |
IAIFoundryCleanupService |
Cleans up Azure AI Foundry resources |
For PDF processing interfaces, see .
For more information on Microsoft Agent Framework and session management, refer to these official resources:
Use WorkflowStateConstants for common state keys:
using Cyclotron.Maf.AgentSdk.Models.Workflow;
// Define your domain-specific scope constants
public static class MyWorkflowStateConstants
{
public static readonly string MyDataScope = nameof(MyDataScope);
}
// Store data in workflow state
await context.QueueStateUpdateAsync(
MyWorkflowStateConstants.MyDataScope,
data,
scopeName: WorkflowStateConstants.GetScopeName(workflowId, MyWorkflowStateConstants.MyDataScope),
cancellationToken);
// Read data from workflow state
var data = await context.ReadStateAsync<MyType>(
MyWorkflowStateConstants.MyDataScope,
scopeName: WorkflowStateConstants.GetScopeName(workflowId, MyWorkflowStateConstants.MyDataScope),
cancellationToken);
| Package | Version |
|---|---|
| Azure.AI.Projects | 1.2.0-beta.1 |
| Azure.AI.OpenAI | 2.5.0-beta.1 |
| Azure.Identity | 1.17.0 |
| Microsoft.Agents.AI.Workflows | 1.0.0-preview.251114.1 |
| Microsoft.Agents.AI.AzureAI | 1.0.0-preview.251114.1 |
| Microsoft.Extensions.AI | 10.0.0 |
| OllamaSharp | 5.0.1 |
| OpenTelemetry | 1.9.0 |
| Handlebars.Net | 2.1.6 |
| Polly.Core | 8.5.0 |
For PDF processing dependencies (PdfPig, System.Drawing.Common), see .
For vector store dependencies (OllamaSharp), see .
See the for a complete working example.
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.4.0 | 102 | 3/11/2026 |
| 1.4.0-alpha.2 | 74 | 3/11/2026 |
| 1.3.0 | 144 | 3/11/2026 |
| 1.3.0-alpha.7 | 73 | 3/11/2026 |
| 1.3.0-alpha.2 | 74 | 3/10/2026 |
| 1.2.0 | 74 | 3/10/2026 |
| 1.1.0 | 209 | 3/2/2026 |
| 1.1.0-alpha.1 | 105 | 2/28/2026 |
| 1.0.0 | 92 | 2/24/2026 |
| 0.2.0-alpha.1 | 92 | 1/1/2026 |
| 0.1.0 | 95 | 1/1/2026 |
| 0.1.0-alpha.5 | 77 | 1/1/2026 |
| 0.1.0-alpha.4 | 850 | 11/26/2025 |