graph LR
    TrustyAI[TrustyAI Service Operator]

    %% External Dependencies - Required
    TrustyAI -->|orchestration| K8s[Kubernetes 1.19+<br/>REQUIRED]

    %% External Dependencies - Optional
    TrustyAI -.->|enhanced features| OpenShift[OpenShift 4.6+<br/>OPTIONAL<br/>Routes, OAuth, Certs]
    TrustyAI -.->|metrics| PrometheusOp[Prometheus Operator<br/>OPTIONAL<br/>ServiceMonitor support]
    TrustyAI -.->|service mesh| Istio[Istio<br/>OPTIONAL<br/>VirtualServices, DestinationRules]
    TrustyAI -.->|certificates| CertManager[cert-manager<br/>OPTIONAL<br/>Alternative to OpenShift certs]

    %% Internal RHOAI Dependencies
    TrustyAI -->|patches/monitors| KServe[KServe<br/>INTERNAL<br/>InferenceService integration]
    TrustyAI -->|deploys| TrustyAIService[TrustyAI Service Image<br/>INTERNAL<br/>quay.io/trustyai/trustyai-service]
    TrustyAI -->|integrates| ModelMesh[Model Mesh<br/>INTERNAL<br/>MM_PAYLOAD_PROCESSORS]
    TrustyAI -->|auth sidecar| OAuthProxy[OpenShift OAuth Proxy<br/>INTERNAL<br/>ose-oauth-proxy]
    TrustyAI -->|metrics scraping| Prometheus[Prometheus<br/>INTERNAL<br/>ServiceMonitor target]

    %% External Services
    TrustyAI -.->|storage option| PostgreSQL[(PostgreSQL<br/>EXTERNAL<br/>Optional database backend)]
    TrustyAI -.->|storage option| MariaDB[(MariaDB<br/>EXTERNAL<br/>Optional database backend)]

    %% Integration Points
    Dashboard[ODH/RHOAI Dashboard] -.->|UI management| TrustyAI
    DataPipelines[Data Science Pipelines] -.->|model monitoring| TrustyAI

    %% Reverse dependencies (what depends on TrustyAI)
    TrustyAI -.->|provides| FairnessMetrics[Fairness Metrics<br/>SPD, DIR]
    TrustyAI -.->|provides| Explainability[Model Explainability<br/>Insights]

    %% Styling
    style TrustyAI fill:#4a90e2,stroke:#333,stroke-width:4px
    style K8s fill:#326ce5,stroke:#333,stroke-width:2px
    style OpenShift fill:#ee0000,stroke:#333,stroke-width:2px
    style KServe fill:#7ed321,stroke:#333
    style TrustyAIService fill:#7ed321,stroke:#333
    style ModelMesh fill:#7ed321,stroke:#333
    style OAuthProxy fill:#7ed321,stroke:#333
    style Prometheus fill:#7ed321,stroke:#333
    style PrometheusOp fill:#999,stroke:#333
    style Istio fill:#999,stroke:#333
    style CertManager fill:#999,stroke:#333
    style PostgreSQL fill:#f5a623,stroke:#333
    style MariaDB fill:#f5a623,stroke:#333
    style Dashboard fill:#7ed321,stroke:#333
    style DataPipelines fill:#7ed321,stroke:#333
    style FairnessMetrics fill:#50e3c2,stroke:#333
    style Explainability fill:#50e3c2,stroke:#333
