GenericAgents.Tools
1.0.0
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
<PackageReference Include="GenericAgents.Tools" Version="1.0.0" />
<PackageVersion Include="GenericAgents.Tools" Version="1.0.0" />
<PackageReference Include="GenericAgents.Tools" />
paket add GenericAgents.Tools --version 1.0.0
#r "nuget: GenericAgents.Tools, 1.0.0"
#:package GenericAgents.Tools@1.0.0
#addin nuget:?package=GenericAgents.Tools&version=1.0.0
#tool nuget:?package=GenericAgents.Tools&version=1.0.0
๐ค Generic AI Agent System
<div align="center">
A production-ready, enterprise-grade AI agent orchestration platform built with .NET 8
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 deploymentsecurity.yml
: Daily security scanning and vulnerability assessmentrelease.yml
: Automated versioning, Docker builds, and GitHub releasespr-check.yml
: Pull request validation and automated code review
๐ Documentation
Quick Reference
- Architecture Guide: Detailed system design and components
- Security Guide: Authentication, authorization, and best practices
- API Documentation: Complete API reference and examples
- Deployment Guide: Production deployment strategies
- Troubleshooting: Common issues and solutions
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! โญ
</div>
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. |
-
net8.0
- GenericAgents.Core (>= 1.0.0)
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.