Agentix.Core 0.2.0

dotnet add package Agentix.Core --version 0.2.0
                    
NuGet\Install-Package Agentix.Core -Version 0.2.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="Agentix.Core" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Agentix.Core" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Agentix.Core" />
                    
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 Agentix.Core --version 0.2.0
                    
#r "nuget: Agentix.Core, 0.2.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 Agentix.Core@0.2.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=Agentix.Core&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Agentix.Core&version=0.2.0
                    
Install as a Cake Tool

Agentix.Core

The core foundation of the Agentix framework, providing abstractions, interfaces, and orchestration logic for building AI-powered .NET applications.

Overview

Agentix.Core is the foundational package that all other Agentix components depend on. It provides:

  • Core Abstractions: Interfaces for AI providers and communication channels
  • Orchestration Engine: Coordinates between providers and channels
  • Dependency Injection: Native .NET DI integration with fluent configuration
  • Error Handling: Comprehensive error handling and logging
  • Lifecycle Management: Background services and cleanup

Installation

dotnet add package Agentix.Core

Quick Start

The core package by itself doesn't provide AI capabilities - you need to add at least one provider and one channel:

using Agentix.Core.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

var builder = Host.CreateDefaultBuilder(args);

// Add core framework
builder.Services.AddAgentixCore(options =>
{
    options.SystemPrompt = "You are a helpful AI assistant.";
    options.EnableCostTracking = true;
});

// Add providers and channels (examples - install separate packages)
// .AddClaudeProvider(options => options.ApiKey = "your-key")
// .AddConsoleChannel();

var app = builder.Build();
await app.RunAsync();

Core Interfaces

IAIProvider

Interface that all AI providers must implement:

public interface IAIProvider
{
    string Name { get; }
    AICapabilities Capabilities { get; }
    
    Task<AIResponse> GenerateAsync(AIRequest request, CancellationToken cancellationToken = default);
    Task<decimal> EstimateCostAsync(AIRequest request);
    Task<bool> HealthCheckAsync(CancellationToken cancellationToken = default);
}

IChannelAdapter

Interface that all communication channels must implement:

public interface IChannelAdapter
{
    string Name { get; }
    string ChannelType { get; }
    bool IsRunning { get; }
    
    Task StartAsync(CancellationToken cancellationToken = default);
    Task StopAsync(CancellationToken cancellationToken = default);
    
    bool SupportsRichContent { get; }
    bool SupportsFileUploads { get; }
    bool SupportsInteractiveElements { get; }
}

IAgentixOrchestrator

The main orchestration service that coordinates between channels and providers:

public interface IAgentixOrchestrator
{
    Task StartAsync(CancellationToken cancellationToken = default);
    Task StopAsync(CancellationToken cancellationToken = default);
    Task<AIResponse> ProcessMessageAsync(IncomingMessage message, CancellationToken cancellationToken = default);
}

Configuration Options

AgentixOptions

Core framework configuration:

services.AddAgentixCore(options =>
{
    // System prompt used by all providers
    options.SystemPrompt = "You are a helpful AI assistant.";
    
    // Enable cost tracking across requests
    options.EnableCostTracking = true;
    
    // Maximum concurrent requests
    options.MaxConcurrentRequests = 10;
    
    // Default request timeout
    options.DefaultTimeout = TimeSpan.FromMinutes(2);
    
    // Error handling
    options.RetryAttempts = 3;
    options.RetryDelay = TimeSpan.FromSeconds(1);
});

Usage Patterns

Basic Setup

var builder = Host.CreateDefaultBuilder(args);

builder.Services
    .AddAgentixCore()
    .AddYourProvider(options => { /* configure */ })
    .AddYourChannel(options => { /* configure */ });

var app = builder.Build();

Web Application Setup

var builder = WebApplication.CreateBuilder(args);

builder.Services
    .AddAgentixCore()
    .AddYourProvider(options => { /* configure */ })
    .AddWebApiChannel();

var app = builder.Build();

// Start Agentix services
await app.StartAgentixAsync();

app.MapControllers();
app.Run();

Manual Orchestrator Usage

// Get the orchestrator service
var orchestrator = serviceProvider.GetRequiredService<IAgentixOrchestrator>();

// Create a message
var message = new IncomingMessage
{
    Content = "Hello, AI!",
    UserId = "user123",
    Channel = "console"
};

// Process the message
var response = await orchestrator.ProcessMessageAsync(message);

Console.WriteLine(response.Content);
Console.WriteLine($"Cost: ${response.EstimatedCost:F4}");

Extension Methods

The core package provides convenient extension methods for common scenarios:

Host Extensions

// Build and run in one line
await Host.CreateDefaultBuilder(args)
    .ConfigureServices(services => services.AddAgentixCore()...)
    .BuildAndRunAgentixAsync();

// Or with more control
var app = builder.Build();
await app.RunAgentixAsync();

Service Collection Extensions

// Fluent configuration
services.AddAgentixCore()
    .AddProvider<MyProvider>()
    .AddChannel<MyChannel>();

Error Handling

The core framework provides comprehensive error handling:

services.AddAgentixCore(options =>
{
    options.RetryAttempts = 3;
    options.RetryDelay = TimeSpan.FromSeconds(2);
    options.EnableDetailedErrors = true; // For development
});

Errors are automatically logged and can be handled at the channel level.

Logging

Agentix integrates with .NET's logging infrastructure:

services.AddLogging(builder =>
{
    builder.AddConsole();
    builder.SetMinimumLevel(LogLevel.Information);
});

// Agentix components will automatically use the configured logger

Available Packages

Once you have the core installed, add providers and channels:

AI Providers

  • Agentix.Providers.Claude - Anthropic Claude integration

Communication Channels

  • Agentix.Channels.Console - Console/terminal interface
  • Agentix.Channels.Slack - Slack bot integration

Advanced Features (Coming Soon)

  • Agentix.Context - Conversation memory and state management
  • Agentix.Tools - Function calling and tool integration
  • Agentix.Rag - Retrieval Augmented Generation

Next Steps

  1. Install a Provider: Add Agentix.Providers.Claude or create your own
  2. Install a Channel: Add Agentix.Channels.Console or create your own
  3. Check Examples: See the samples/ directory for complete examples
  4. Read Documentation: Review the design document

Contributing

See CONTRIBUTING.md for guidelines on extending the core framework.

License

This project is licensed under the MIT License.

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 (4)

Showing the top 4 NuGet packages that depend on Agentix.Core:

Package Downloads
Agentix.Channels.Console

Console channel adapter for Agentix AI agent framework

Agentix.Providers.Claude

Anthropic Claude AI provider for Agentix AI agent framework

Agentix.Channels.Slack

Slack channel adapter for Agentix AI agent framework

Agentix.Context.InMemory

In-memory context storage implementation for Agentix.Net framework. Suitable for development and single-instance deployments.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 459 7/21/2025
0.1.1 391 7/21/2025
0.1.0 388 7/21/2025