GenericAgents.Tools 1.0.0

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

๐Ÿค– Generic AI Agent System

<div align="center">

A production-ready, enterprise-grade AI agent orchestration platform built with .NET 8

CI/CD Security Tests Docker .NET

Transform your applications with intelligent, scalable AI agent workflows

Quick Start โ€ข Architecture โ€ข Use Cases โ€ข Documentation

</div>


๐ŸŒŸ Why Generic AI Agent System?

The Generic AI Agent System provides a robust foundation for building intelligent, autonomous workflows in any application. Whether you're developing customer service automation, content processing pipelines, or complex decision-making systems, this platform offers enterprise-grade infrastructure for AI agent orchestration.

โœจ Key Benefits

  • ๐Ÿš€ Production Ready: Enterprise-grade security, monitoring, and CI/CD
  • ๐Ÿ”’ Secure by Design: JWT authentication, RBAC authorization, secret management
  • ๐Ÿ“Š Observable: Comprehensive metrics, logging, and monitoring
  • ๐Ÿ—๏ธ Scalable Architecture: Microservices with Docker containerization
  • ๐Ÿงช Test-Driven: 100% test coverage with automated quality assurance
  • ๐Ÿ”„ CI/CD Ready: Automated testing, security scanning, and deployment

๐Ÿš€ Quick Start

Prerequisites

  • Docker and Docker Compose
  • .NET 8 SDK (for development)
  • Git

1. Clone and Setup

git clone <repository-url>
cd generic_agents

# Generate secure environment variables
cat > .env << EOF
POSTGRES_PASSWORD=$(openssl rand -base64 32)
REDIS_PASSWORD=$(openssl rand -base64 32)  
GRAFANA_ADMIN_PASSWORD=$(openssl rand -base64 32)
JWT_SIGNING_KEY=$(openssl rand -base64 64)
EOF

2. Launch the Platform

# Start all services
docker-compose up -d

# Verify system health
curl http://localhost:8080/health

3. Access Services

  • ๐Ÿค– Agent API: http://localhost:8080/health
  • ๐Ÿ“Š Grafana Dashboard: http://localhost:3000 (admin / your_grafana_password)
  • ๐Ÿ“ˆ Prometheus Metrics: http://localhost:9090
  • ๐Ÿ—„๏ธ Database: PostgreSQL on port 5432
  • โšก Cache: Redis on port 6379

4. Verify Everything Works

# Run the full test suite
dotnet test --configuration Release

# Check security status
docker-compose logs agent-api | grep -i "authentication\|authorization"

# View metrics
curl http://localhost:8080/metrics

๐Ÿ—๏ธ Architecture

<div align="center">

graph TB
    Client[Client Applications] --> Gateway[API Gateway]
    Gateway --> Auth[JWT Authentication]
    Auth --> RBAC[RBAC Authorization]
    RBAC --> Core[Agent.Core]
    
    Core --> Orchestration[Agent.Orchestration]
    Core --> Tools[Agent.Tools]
    Core --> Config[Agent.Configuration]
    
    Orchestration --> Workflow[Workflow Engine]
    Tools --> Execution[Tool Execution]
    
    Core --> Observability[Agent.Observability]
    Observability --> Prometheus[Prometheus]
    Observability --> Grafana[Grafana]
    
    Core --> Security[Agent.Security]
    Security --> Secrets[Secret Management]
    Security --> KeyVault[Azure Key Vault]
    
    Core --> Database[(PostgreSQL)]
    Core --> Cache[(Redis)]

</div>

๐Ÿ”ง Core Components

Component Purpose Key Features
๐Ÿค– Agent.Core Foundation layer Abstractions, interfaces, domain models
โš™๏ธ Agent.Configuration Configuration management Validation, environment-specific settings
๐ŸŽญ Agent.Orchestration Workflow engine Agent coordination, task scheduling
๐Ÿ“Š Agent.Observability Monitoring & metrics Prometheus integration, health checks
๐Ÿ”ง Agent.Tools Tool execution Extensible tool framework
๐Ÿ”’ Agent.Security Security framework JWT, RBAC, secret management
๐Ÿงช Agent.Performance Performance optimization Benchmarking, resource management

๐Ÿ”’ Security Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   Client Request                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚          JWT Authentication Middleware             โ”‚
โ”‚  โ€ข Local JWT (Development)                         โ”‚
โ”‚  โ€ข Okta Integration (Production)                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚              RBAC Authorization                     โ”‚
โ”‚  โ€ข Admin: Full system access                       โ”‚
โ”‚  โ€ข User: Limited with permissions                  โ”‚
โ”‚  โ€ข Service: System-to-system                       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                Application Logic                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚               Secret Management                     โ”‚
โ”‚  โ€ข Environment Variables (Dev)                     โ”‚
โ”‚  โ€ข Azure Key Vault (Production)                    โ”‚
โ”‚  โ€ข Cached Secret Manager (Performance)             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ’ก Use Cases

๐Ÿ› ๏ธ Integration Scenarios

The Generic AI Agent System is designed to enhance your existing applications with intelligent automation. Here are key scenarios where this platform adds significant value:

1. ๐Ÿ“ž Customer Service Automation

Problem: High volume of repetitive customer inquiries overwhelming support teams.

Solution with Agent System:

// Your existing customer service API
[HttpPost("/tickets")]
public async Task<IActionResult> CreateTicket(TicketRequest request)
{
    // Traditional approach: Direct to human agents
    
    // Enhanced with Agent System:
    var agentWorkflow = await _agentOrchestrator.CreateWorkflowAsync(
        "customer-service-triage",
        new { ticket = request, priority = "auto-classify" }
    );
    
    var result = await agentWorkflow.ExecuteAsync();
    
    if (result.CanBeAutomated)
    {
        return Ok(await _agentSystem.HandleAutomatically(request));
    }
    
    // Route to human agent with AI insights
    return Ok(await RouteToHumanAgent(request, result.Insights));
}

Benefits: 70% reduction in manual ticket handling, instant response times, 24/7 availability.

2. ๐Ÿ“ Content Processing Pipeline

Problem: Manual content review and processing bottlenecks.

Solution Integration:

// Your existing CMS or content system
[HttpPost("/content/process")]
[RequireWorkflowManager] // Uses Agent System RBAC
public async Task<IActionResult> ProcessContent(ContentRequest request)
{
    // Create multi-step AI workflow
    var pipeline = await _agentOrchestrator.CreateWorkflowAsync("content-pipeline", new
    {
        steps = new[]
        {
            "content-analysis",      // AI analyzes content quality
            "seo-optimization",      // AI suggests SEO improvements  
            "compliance-check",      // AI checks regulatory compliance
            "auto-categorization"    // AI categorizes and tags
        },
        content = request.Content
    });
    
    var result = await pipeline.ExecuteAsync();
    
    // Your existing business logic enhanced with AI insights
    return Ok(new ContentProcessingResult 
    {
        OriginalContent = request.Content,
        AIInsights = result.Insights,
        Recommendations = result.Recommendations,
        ComplianceStatus = result.ComplianceStatus
    });
}

Benefits: 10x faster processing, consistent quality checks, automated compliance.

3. ๐Ÿ” Document Intelligence & Workflow Automation

Problem: Complex document processing requiring multiple steps and approvals.

Solution Integration:

// Your existing document management system
public class DocumentProcessingService
{
    private readonly IAgentOrchestrator _orchestrator;
    private readonly IYourExistingDocumentService _documentService;
    
    public async Task<ProcessingResult> ProcessDocumentAsync(Document document)
    {
        // Create intelligent document workflow
        var workflow = await _orchestrator.CreateWorkflowAsync("document-intelligence", new
        {
            document = document,
            steps = new[]
            {
                "extract-metadata",     // AI extracts key information
                "classify-document",    // AI determines document type
                "validate-content",     // AI validates completeness
                "route-for-approval",   // AI determines approval workflow
                "generate-summary"      // AI creates executive summary
            }
        });
        
        var aiResults = await workflow.ExecuteAsync();
        
        // Integrate AI results with your existing business logic
        var processedDoc = await _documentService.EnhanceWithAI(document, aiResults);
        
        // Route based on AI recommendations
        if (aiResults.RequiresHumanReview)
        {
            await _documentService.RouteForHumanReview(processedDoc, aiResults.ReviewReasons);
        }
        else
        {
            await _documentService.AutoApprove(processedDoc);
        }
        
        return new ProcessingResult
        {
            Document = processedDoc,
            AIInsights = aiResults,
            ProcessingTime = workflow.ExecutionTime,
            AutomationLevel = aiResults.AutomationConfidence
        };
    }
}

Benefits: 90% faster document processing, consistent classification, intelligent routing.

4. ๐Ÿ›’ E-commerce Intelligence

Problem: Complex product recommendations, pricing optimization, and inventory management.

Integration Example:

// Your existing e-commerce platform
[HttpGet("/products/recommendations/{userId}")]
[RequirePermission("product:read")] // Uses Agent System authorization
public async Task<IActionResult> GetPersonalizedRecommendations(string userId)
{
    // Create AI-driven recommendation workflow
    var recommendationWorkflow = await _agentOrchestrator.CreateWorkflowAsync(
        "personalized-recommendations", 
        new 
        {
            userId = userId,
            context = await GetUserContext(userId),
            algorithms = new[] 
            {
                "collaborative-filtering",
                "content-based-filtering",
                "behavioral-analysis",
                "trend-analysis"
            }
        }
    );
    
    var aiRecommendations = await recommendationWorkflow.ExecuteAsync();
    
    // Combine AI insights with your business rules
    var finalRecommendations = await _productService.ApplyBusinessRules(
        aiRecommendations.Products,
        aiRecommendations.Confidence,
        await GetInventoryStatus()
    );
    
    return Ok(new RecommendationResponse
    {
        Products = finalRecommendations,
        AIInsights = aiRecommendations.Reasoning,
        PersonalizationScore = aiRecommendations.PersonalizationScore
    });
}
5. ๐Ÿฅ Healthcare Workflow Automation

Problem: Complex patient care workflows with multiple decision points.

Integration Pattern:

// Your existing healthcare system
public class PatientCareWorkflowService
{
    public async Task<CareRecommendation> ProcessPatientDataAsync(PatientData patient)
    {
        // HIPAA-compliant AI workflow
        var careWorkflow = await _secureOrchestrator.CreateWorkflowAsync(
            "patient-care-analysis",
            new 
            {
                patientData = patient.Anonymized(), // Your anonymization logic
                workflows = new[]
                {
                    "symptom-analysis",
                    "risk-assessment", 
                    "treatment-options",
                    "care-coordination"
                },
                complianceLevel = "HIPAA"
            }
        );
        
        var aiInsights = await careWorkflow.ExecuteAsync();
        
        // Your existing medical logic enhanced with AI
        var recommendations = await _medicalService.ValidateWithMedicalRules(
            aiInsights,
            patient.MedicalHistory
        );
        
        return new CareRecommendation
        {
            PatientId = patient.Id,
            AIInsights = aiInsights.ClinicalInsights,
            RecommendedActions = recommendations.Actions,
            UrgencyLevel = aiInsights.UrgencyAssessment,
            RequiresPhysicianReview = recommendations.RequiresReview
        };
    }
}

๐Ÿ”„ Common Integration Patterns

Pattern 1: AI-Enhanced Decision Making
// Before: Manual decision logic
if (complexBusinessCondition1 && complexBusinessCondition2)
{
    return ProcessManually();
}

// After: AI-enhanced with fallback to business rules
var aiDecision = await _agentSystem.GetDecisionRecommendation(context);
if (aiDecision.Confidence > 0.8)
{
    return ProcessWithAI(aiDecision);
}
return ProcessWithBusinessRules(context); // Fallback to existing logic
Pattern 2: Gradual AI Adoption
// Start with AI insights alongside existing logic
public async Task<ProcessingResult> ProcessRequest(Request request)
{
    // Your existing processing (unchanged)
    var traditionalResult = await _existingService.Process(request);
    
    // Add AI insights in parallel (no risk)
    var aiInsights = await _agentSystem.AnalyzeRequest(request);
    
    // Combine both approaches
    return new EnhancedResult
    {
        TraditionalResult = traditionalResult,
        AIInsights = aiInsights,
        Recommendations = aiInsights.SuggestedImprovements
    };
}
Pattern 3: Workflow Orchestration
// Complex multi-step process made simple
var workflow = await _agentOrchestrator.CreateWorkflowAsync("multi-step-process", new
{
    steps = new[]
    {
        new { name = "validate-input", useAI = true },
        new { name = "process-data", useAI = true },
        new { name = "generate-output", useAI = false }, // Your existing logic
        new { name = "quality-check", useAI = true }
    },
    data = inputData
});

var result = await workflow.ExecuteAsync();

๐Ÿ”’ Security Features

๐Ÿ›ก๏ธ Enterprise-Grade Security

  • ๐Ÿ” JWT Authentication: Local development + Okta production integration
  • ๐Ÿ‘ฅ RBAC Authorization: Role-based access control with fine-grained permissions
  • ๐Ÿ”‘ Secret Management: Azure Key Vault integration with local development support
  • ๐Ÿšซ Zero Hardcoded Secrets: All sensitive data externalized
  • ๐Ÿ” Security Scanning: Automated vulnerability detection and dependency auditing

๐Ÿ—๏ธ Security Architecture

// Example: Securing your AI agent endpoints
[RequireAdmin] // Only administrators
public async Task<IActionResult> ManageSystemAgents()
{
    return Ok(await _agentManager.GetAllAgents());
}

[RequireWorkflowManager] // Admin or users with workflow:manage permission
public async Task<IActionResult> CreateWorkflow(WorkflowRequest request)
{
    var userId = HttpContext.GetJwtUserId();
    return Ok(await _orchestrator.CreateWorkflowAsync(request, userId));
}

[RequirePermission("metrics:view")] // Fine-grained permission control
public async Task<IActionResult> GetMetrics()
{
    return Ok(await _metricsService.GetSystemMetrics());
}

๐Ÿ“Š Monitoring & Observability

Built-in Monitoring Stack

  • ๐Ÿ“ˆ Prometheus: Metrics collection and storage
  • ๐Ÿ“Š Grafana: Rich dashboards and visualization
  • ๐Ÿ” Health Checks: Comprehensive system health monitoring
  • ๐Ÿ“ Structured Logging: Centralized log aggregation
  • โšก Performance Metrics: Agent execution times, throughput, error rates

Key Metrics Tracked

// Automatic metrics collection for your AI workflows
public async Task<WorkflowResult> ExecuteWorkflow(string workflowId)
{
    using var timer = _metrics.StartTimer("workflow_execution_duration");
    
    try
    {
        var result = await _orchestrator.ExecuteAsync(workflowId);
        _metrics.Counter("workflow_executions_total").WithTag("status", "success").Increment();
        return result;
    }
    catch (Exception ex)
    {
        _metrics.Counter("workflow_executions_total").WithTag("status", "error").Increment();
        _metrics.Counter("workflow_errors_total").WithTag("error_type", ex.GetType().Name).Increment();
        throw;
    }
}

๐Ÿงช Testing

Comprehensive Test Coverage

  • โœ… Unit Tests: All core components with 100% coverage
  • โœ… Integration Tests: End-to-end workflow testing
  • โœ… Security Tests: Authentication and authorization validation
  • โœ… Performance Tests: Load testing and benchmarking
  • โœ… Contract Tests: API compatibility verification

Running Tests

# Run all tests
dotnet test --configuration Release

# Run with coverage
dotnet test --collect:"XPlat Code Coverage"

# Run specific test categories
dotnet test --filter "Category=Security"
dotnet test --filter "Category=Integration"
dotnet test --filter "Category=Performance"

# Run in Docker (matches CI environment)
docker-compose -f docker-compose.test.yml up --abort-on-container-exit

๐Ÿš€ CI/CD Pipeline

Automated Quality Assurance

  • ๐Ÿงช Multi-project Testing: Parallel test execution across all components
  • ๐Ÿ”’ Security Scanning: Daily vulnerability scans and dependency audits
  • ๐Ÿ“Š Code Quality: Static analysis and code coverage reporting
  • ๐Ÿณ Container Security: Docker image vulnerability scanning
  • ๐Ÿš€ Automated Deployment: Development and production pipeline

GitHub Actions Workflows

  • ci.yml: Comprehensive CI/CD with testing, building, and deployment
  • security.yml: Daily security scanning and vulnerability assessment
  • release.yml: Automated versioning, Docker builds, and GitHub releases
  • pr-check.yml: Pull request validation and automated code review

๐Ÿ“š Documentation

Quick Reference

Development Resources

# Generate API documentation
dotnet tool install -g Microsoft.dotnet-openapi
dotnet openapi add url https://localhost:8080/swagger/v1/swagger.json

# View system metrics
curl http://localhost:8080/metrics

# Check health status
curl http://localhost:8080/health | jq

# View configuration
curl http://localhost:8080/configuration | jq

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone the repository
git clone <repository-url>
cd generic_agents

# Install .NET 8 SDK
# Setup development environment
dotnet restore
dotnet build

# Run tests
dotnet test

# Start development services
docker-compose -f docker-compose.dev.yml up -d

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ†˜ Support

  • ๐Ÿ“– Documentation: docs/
  • ๐Ÿ› Issues: GitHub Issues
  • ๐Ÿ’ฌ Discussions: GitHub Discussions
  • ๐Ÿ“ง Enterprise Support: Contact us for enterprise support options

<div align="center">

โญ If this project helps you build better AI agent workflows, please give it a star! โญ

โฌ† Back to Top

</div>

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

Showing the top 3 NuGet packages that depend on GenericAgents.Tools:

Package Downloads
GenericAgents.Registry

Tool registry and discovery system for dynamically registering and managing agent tools and capabilities.

GenericAgents.Orchestration

Workflow orchestration engine for coordinating complex multi-agent workflows with retry policies, health monitoring, and execution strategies.

GenericAgents.Tools.Samples

Sample tool implementations demonstrating file system operations, HTTP requests, and text processing for AI agent workflows.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 68 9/26/2025
1.0.1 118 9/25/2025
1.0.0 117 9/25/2025