# BDR Agent Factory - Architecture ## System Overview The BDR Agent Factory is a cloud-native, microservices-based platform for managing and deploying AI capabilities in insurance systems. ``` ┌─────────────────────────────────────────────────────────────────────────┐ │ BDR Agent Factory Platform │ ├─────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │ API │ │ Capability │ │ Governance │ │ │ │ Gateway │──│ Registry │──│ Engine │ │ │ └──────────────┘ └──────────────┘ └──────────────┘ │ │ │ │ │ │ │ ▼ ▼ ▼ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │ Capability Execution Layer │ │ │ ├──────────────────────────────────────────────────────┤ │ │ │ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │ │ │ │ │ Text │ │ Fraud │ │Vision │ │Document│ │ │ │ │ │Classify│ │Detect │ │Analysis│ │ Parse │ │ │ │ │ └────────┘ └────────┘ └────────┘ └────────┘ │ │ │ └──────────────────────────────────────────────────────┘ │ │ │ │ │ │ │ ▼ ▼ ▼ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │ Data & Model Layer │ │ │ ├──────────────────────────────────────────────────────┤ │ │ │ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │ │ │ │ │ Model │ │Feature │ │Training│ │ Audit │ │ │ │ │ │Registry│ │ Store │ │ Data │ │ DB │ │ │ │ │ └────────┘ └────────┘ └────────┘ └────────┘ │ │ │ └──────────────────────────────────────────────────────┘ │ │ │ │ │ │ │ ▼ ▼ ▼ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │ Monitoring & Observability Layer │ │ │ ├──────────────────────────────────────────────────────┤ │ │ │ Prometheus │ Grafana │ Elasticsearch │ Jaeger │ │ │ └──────────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────────────────┐ │ Business Systems Layer │ ├─────────────────────────────────────────────────────────────────────────┤ │ ClaimsGPT │ FraudAgent │ PolicyAgent │ DamageAgent │ CustomerAgent │ └─────────────────────────────────────────────────────────────────────────┘ ``` --- ## Component Architecture ### 1. API Gateway ``` ┌─────────────────────────────────────────────────────────────┐ │ API Gateway │ ├─────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │ Auth │ │ Rate │ │ Request │ │ │ │ Service │ │ Limiter │ │ Validator │ │ │ └──────────────┘ └──────────────┘ └──────────────┘ │ │ │ │ │ │ │ └──────────────────┴──────────────────┘ │ │ │ │ │ ▼ │ │ ┌──────────────┐ │ │ │ Router │ │ │ └──────────────┘ │ │ │ │ │ ┌──────────────────┼──────────────────┐ │ │ ▼ ▼ ▼ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ │Capability│ │ System │ │Governance│ │ │ │ API │ │ API │ │ API │ │ │ └──────────┘ └──────────┘ └──────────┘ │ │ │ └─────────────────────────────────────────────────────────────┘ ``` **Responsibilities:** - Authentication and authorization - Rate limiting and throttling - Request validation and sanitization - Routing to appropriate services - Response aggregation - API versioning **Technology Stack:** - Kong or AWS API Gateway - OAuth 2.0 / JWT - Redis for rate limiting --- ### 2. Capability Registry ``` ┌─────────────────────────────────────────────────────────────┐ │ Capability Registry │ ├─────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────────────────────────────────────────┐ │ │ │ Capability Metadata Store │ │ │ ├──────────────────────────────────────────────────┤ │ │ │ • Capability ID │ │ │ │ • Version │ │ │ │ • Input/Output Schema │ │ │ │ • Performance Metrics │ │ │ │ • Compliance Flags │ │ │ │ • Dependencies │ │ │ └──────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌──────────────────────────────────────────────────┐ │ │ │ Version Management │ │ │ ├──────────────────────────────────────────────────┤ │ │ │ • Active Versions │ │ │ │ • Deprecated Versions │ │ │ │ • Rollback History │ │ │ │ • A/B Testing Config │ │ │ └──────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌──────────────────────────────────────────────────┐ │ │ │ Discovery Service │ │ │ ├──────────────────────────────────────────────────┤ │ │ │ • Service Endpoints │ │ │ │ • Health Checks │ │ │ │ • Load Balancing │ │ │ └──────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────┘ ``` **Technology Stack:** - PostgreSQL for metadata - Consul or etcd for service discovery - Redis for caching --- ### 3. Capability Execution Engine ``` ┌─────────────────────────────────────────────────────────────┐ │ Capability Execution Engine │ ├─────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────────────────────────────────────────┐ │ │ │ Request Processor │ │ │ └──────────────────────────────────────────────────┘ │ │ │ │ │ ┌──────────────────┼──────────────────┐ │ │ ▼ ▼ ▼ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ │ Input │ │ Model │ │ Output │ │ │ │Validation│ │Inference │ │Formatting│ │ │ └──────────┘ └──────────┘ └──────────┘ │ │ │ │ │ │ │ └──────────────────┴──────────────────┘ │ │ │ │ │ ▼ │ │ ┌──────────────────────────────────────────────────┐ │ │ │ Explainability Engine │ │ │ ├──────────────────────────────────────────────────┤ │ │ │ • SHAP Values │ │ │ │ • Feature Importance │ │ │ │ • Counterfactuals │ │ │ └──────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌──────────────────────────────────────────────────┐ │ │ │ Audit Trail Generator │ │ │ ├──────────────────────────────────────────────────┤ │ │ │ • Request Hash │ │ │ │ • Response Hash │ │ │ │ • Compliance Flags │ │ │ │ • Retention Policy │ │ │ └──────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────┘ ``` **Technology Stack:** - Python/FastAPI for API services - PyTorch/TensorFlow for ML models - Celery for async processing - RabbitMQ/Kafka for message queue --- ### 4. Data Flow Architecture ``` ┌─────────────┐ │ Client │ └──────┬──────┘ │ 1. API Request (HTTPS) ▼ ┌─────────────────────────────────────────┐ │ API Gateway │ │ • Authentication (OAuth 2.0) │ │ • Rate Limiting │ │ • Input Validation │ └──────┬──────────────────────────────────┘ │ 2. Validated Request ▼ ┌─────────────────────────────────────────┐ │ Capability Registry │ │ • Lookup Capability │ │ • Get Version Config │ │ • Route to Service │ └──────┬──────────────────────────────────┘ │ 3. Routed Request ▼ ┌─────────────────────────────────────────┐ │ Capability Service (e.g., Text │ │ Classification) │ │ ┌───────────────────────────────────┐ │ │ │ 4. Load Model from Registry │ │ │ └───────────────────────────────────┘ │ │ ┌───────────────────────────────────┐ │ │ │ 5. Perform Inference │ │ │ └───────────────────────────────────┘ │ │ ┌───────────────────────────────────┐ │ │ │ 6. Generate Explanation (SHAP) │ │ │ └───────────────────────────────────┘ │ │ ┌───────────────────────────────────┐ │ │ │ 7. Create Audit Trail │ │ │ └───────────────────────────────────┘ │ └──────┬──────────────────────────────────┘ │ 8. Response with Results ▼ ┌─────────────────────────────────────────┐ │ API Gateway │ │ • Format Response │ │ • Add Headers │ └──────┬──────────────────────────────────┘ │ 9. API Response (JSON) ▼ ┌─────────────┐ │ Client │ └─────────────┘ Parallel Processes: ┌─────────────────────────────────┐ │ Monitoring & Logging │ │ • Metrics (Prometheus) │ │ • Logs (Elasticsearch) │ │ • Traces (Jaeger) │ └─────────────────────────────────┘ ┌─────────────────────────────────┐ │ Audit Storage │ │ • PostgreSQL (Hot) │ │ • S3 (Cold Archive) │ └─────────────────────────────────┘ ``` --- ### 5. Deployment Architecture ``` ┌─────────────────────────────────────────────────────────────────────────┐ │ Cloud Infrastructure │ │ (AWS/GCP/Azure) │ ├─────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ Kubernetes Cluster │ │ │ ├──────────────────────────────────────────────────────────────┤ │ │ │ │ │ │ │ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │ │ │ │ │ Namespace: │ │ Namespace: │ │ Namespace: │ │ │ │ │ │ API Services │ │ Capabilities │ │ Monitoring │ │ │ │ │ ├────────────────┤ ├────────────────┤ ├────────────────┤ │ │ │ │ │ • API Gateway │ │ • Text Classify│ │ • Prometheus │ │ │ │ │ │ • Auth Service │ │ • Fraud Detect │ │ • Grafana │ │ │ │ │ │ • Registry │ │ • NER │ │ • ELK Stack │ │ │ │ │ └────────────────┘ │ • Sentiment │ │ • Jaeger │ │ │ │ │ └────────────────┘ └────────────────┘ │ │ │ │ │ │ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │ │ │ Ingress Controller (NGINX) │ │ │ │ │ └──────────────────────────────────────────────────────┘ │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────┘ │ │ │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ Managed Services │ │ │ ├──────────────────────────────────────────────────────────────┤ │ │ │ • RDS (PostgreSQL) - Metadata & Audit │ │ │ │ • ElastiCache (Redis) - Caching & Rate Limiting │ │ │ │ • S3 - Model Storage & Audit Archive │ │ │ │ • SQS/SNS - Message Queue │ │ │ │ • CloudWatch - Monitoring & Alerting │ │ │ │ • Secrets Manager - API Keys & Credentials │ │ │ └──────────────────────────────────────────────────────────────┘ │ │ │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ Security Layer │ │ │ ├──────────────────────────────────────────────────────────────┤ │ │ │ • WAF (Web Application Firewall) │ │ │ │ • DDoS Protection │ │ │ │ • VPC with Private Subnets │ │ │ │ • Security Groups & NACLs │ │ │ │ • KMS for Encryption │ │ │ └──────────────────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────────┘ ``` --- ### 6. Security Architecture ``` ┌─────────────────────────────────────────────────────────────────────────┐ │ Security Layers │ ├─────────────────────────────────────────────────────────────────────────┤ │ │ │ Layer 1: Network Security │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ • WAF (SQL Injection, XSS Protection) │ │ │ │ • DDoS Protection (CloudFlare/AWS Shield) │ │ │ │ • VPC with Private Subnets │ │ │ │ • Security Groups (Least Privilege) │ │ │ └──────────────────────────────────────────────────────────────┘ │ │ ▼ │ │ Layer 2: Application Security │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ • OAuth 2.0 Authentication │ │ │ │ • JWT Token Validation (RS256) │ │ │ │ • RBAC Authorization │ │ │ │ • Rate Limiting (100-1000 req/min) │ │ │ └──────────────────────────────────────────────────────────────┘ │ │ ▼ │ │ Layer 3: Data Security │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ • TLS 1.3 (Data in Transit) │ │ │ │ • AES-256 (Data at Rest) │ │ │ │ • Field-Level Encryption (PII) │ │ │ │ • Key Management (AWS KMS) │ │ │ └──────────────────────────────────────────────────────────────┘ │ │ ▼ │ │ Layer 4: Audit & Compliance │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ • Complete Audit Trails │ │ │ │ • SIEM Integration │ │ │ │ • Compliance Monitoring (GDPR, HIPAA) │ │ │ │ • 7-Year Data Retention │ │ │ └──────────────────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────────┘ ``` --- ### 7. Scalability Architecture ``` ┌─────────────────────────────────────────────────────────────────────────┐ │ Horizontal Scaling │ ├─────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ Load Balancer (Application LB) │ │ │ └────────────────────┬─────────────────────────────────────────┘ │ │ │ │ │ ┌─────────────┼─────────────┬─────────────┐ │ │ ▼ ▼ ▼ ▼ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ │ Pod 1 │ │ Pod 2 │ │ Pod 3 │ │ Pod N │ │ │ │ (API GW) │ │ (API GW) │ │ (API GW) │ │ (API GW) │ │ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │ │ │ Auto-Scaling Rules: │ │ • CPU > 70% → Scale Up │ │ • Memory > 80% → Scale Up │ │ • Request Queue > 100 → Scale Up │ │ • Min Replicas: 3, Max Replicas: 50 │ │ │ └─────────────────────────────────────────────────────────────────────────┘ ┌─────────────────────────────────────────────────────────────────────────┐ │ Database Scaling │ ├─────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────────────────────────────────────────────────────┐ │ │ │ Primary Database (Write) │ │ │ └────────────────────┬─────────────────────────────────────────┘ │ │ │ Replication │ │ ┌─────────────┼─────────────┬─────────────┐ │ │ ▼ ▼ ▼ ▼ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ │ Replica 1│ │ Replica 2│ │ Replica 3│ │ Replica N│ │ │ │ (Read) │ │ (Read) │ │ (Read) │ │ (Read) │ │ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │ │ │ Sharding Strategy: │ │ • Shard by Capability ID │ │ • Shard by Timestamp (for audit data) │ │ │ └─────────────────────────────────────────────────────────────────────────┘ ``` --- ### 8. Disaster Recovery Architecture ``` ┌─────────────────────────────────────────────────────────────────────────┐ │ Multi-Region Deployment │ ├─────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────────────────────────┐ ┌──────────────────────────────┐│ │ │ Primary Region (US-East) │ │ Secondary Region (US-West) ││ │ ├──────────────────────────────────┤ ├──────────────────────────────┤│ │ │ • Active-Active Setup │ │ • Active-Active Setup ││ │ │ • Full Capability Deployment │ │ • Full Capability Deployment││ │ │ • Real-time Replication │ │ • Real-time Replication ││ │ └──────────────────────────────────┘ └──────────────────────────────┘│ │ │ │ │ │ └──────────┬───────────────────┘ │ │ ▼ │ │ ┌──────────────────────────┐ │ │ │ Global Load Balancer │ │ │ │ (Route 53 / CloudFlare) │ │ │ └──────────────────────────┘ │ │ │ │ Backup Strategy: │ │ • Continuous Replication (RPO: 0 seconds) │ │ • Automated Failover (RTO: < 5 minutes) │ │ • Daily Snapshots (Retained 30 days) │ │ • Weekly Full Backups (Retained 1 year) │ │ │ └─────────────────────────────────────────────────────────────────────────┘ ``` --- ## Technology Stack Summary ### Infrastructure - **Cloud Provider**: AWS (Primary), GCP (Secondary) - **Container Orchestration**: Kubernetes (EKS/GKE) - **Service Mesh**: Istio - **Infrastructure as Code**: Terraform ### Application - **API Framework**: FastAPI (Python) - **ML Framework**: PyTorch, TensorFlow - **Message Queue**: RabbitMQ, Apache Kafka - **Caching**: Redis - **Search**: Elasticsearch ### Data - **Relational DB**: PostgreSQL (RDS) - **Object Storage**: S3 - **Data Warehouse**: Snowflake - **Feature Store**: Feast ### Monitoring - **Metrics**: Prometheus - **Visualization**: Grafana - **Logging**: ELK Stack (Elasticsearch, Logstash, Kibana) - **Tracing**: Jaeger - **APM**: Datadog ### Security - **Authentication**: OAuth 2.0, JWT - **Secrets Management**: AWS Secrets Manager - **Encryption**: AWS KMS - **WAF**: AWS WAF, CloudFlare --- ## Performance Characteristics ### Latency Targets - **P50**: < 100ms - **P95**: < 300ms - **P99**: < 500ms ### Throughput Targets - **API Gateway**: 10,000 requests/second - **Individual Capability**: 100-1,000 requests/second - **Batch Processing**: 1,000,000 items/hour ### Availability Targets - **SLA**: 99.99% uptime - **RTO**: < 5 minutes - **RPO**: 0 seconds (continuous replication) --- ## Future Architecture Enhancements 1. **Edge Computing**: Deploy capabilities closer to users 2. **Serverless**: Migrate to serverless for cost optimization 3. **GraphQL**: Add GraphQL API alongside REST 4. **gRPC**: Use gRPC for internal service communication 5. **Multi-Cloud**: Expand to Azure for redundancy --- **Last Updated**: January 3, 2026 **Version**: 1.0.0