# abiroland/ai-mrg-framework architecture

> Architecture diagram of the GitHub repository abiroland/ai-mrg-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abiroland/ai-mrg-framework
- Repository: https://github.com/abiroland/ai-mrg-framework

## Overview

AI-MRG is a self-hosted model-risk governance toolkit. Its main workflow registers an AI system, classifies and tiers it, plans applicable controls, runs checks and records evidence, then supports gated lifecycle review and audit-ready reporting. The map also preserves the documented dashboard, REST API, MLflow integration, and control-pack capabilities. Edges are based on the README workflow, source-index references, and shown excerpts; some subsystem wiring is documented but not sampled in source.

Main entry points: [`src/aimrg/cli.py`](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/cli.py) (Command line), [`src/aimrg/registry/store.py`](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/registry/store.py) (Governance registry), [`src/aimrg/dashboard/app.py`](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/dashboard/app.py) (Web dashboard), [`src/aimrg/integrations/mlflow.py`](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/integrations/mlflow.py) (MLflow integration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_governance["Governance workflow"]
  node_domain["Governance records<br/>[models.py]"]
  node_classification["AI classification<br/>[classify.py]"]
  node_tiering["Risk tiering<br/>[tiering.py]"]
  node_workflow["Lifecycle gates<br/>[workflow.py]"]
end

subgraph group_controls["Controls and checks"]
  node_packs["Control packs<br/>[loader.py]"]
  node_pack_rules["Control applicability<br/>[resolver.py]"]
  node_checks["Checks library"]
  node_check_framework["Check framework<br/>[base.py]"]
end

subgraph group_records["Records and reporting"]
  node_registry[("Governance registry<br/>[store.py]")]
  node_findings["Findings<br/>[findings.py]"]
  node_reports["Governance reports<br/>[render.py]"]
  node_export["Evidence export<br/>[export.py]"]
end

subgraph group_interfaces["User interfaces"]
  node_cli["Command line<br/>[cli.py]"]
  node_api["REST API<br/>[api.py]"]
  node_dashboard["Web dashboard<br/>[app.py]"]
  node_dashboard_views["Dashboard views<br/>[views.py]"]
  node_dashboard_client["API client<br/>[client.py]"]
end

subgraph group_integrations["Integrations"]
  node_mlflow["MLflow integration<br/>[mlflow.py]"]
end

node_user(("Practitioner"))
node_external_mlflow(("MLflow"))

node_user -->|"runs commands"| node_cli
node_user -->|"uses interface"| node_dashboard
node_user -->|"calls endpoints"| node_api
node_cli -->|"manages records"| node_registry
node_api -->|"serves requests"| node_registry
node_dashboard -->|"renders views"| node_dashboard_views
node_dashboard -->|"uses client"| node_dashboard_client
node_registry -->|"validates records"| node_domain
node_cli -->|"classifies assets"| node_classification
node_classification -->|"builds classification"| node_domain
node_cli -->|"assesses risk"| node_tiering
node_cli -->|"loads controls"| node_packs
node_packs -->|"supplies controls"| node_pack_rules
node_cli -->|"runs checks"| node_checks
node_checks -->|"uses framework"| node_check_framework
node_cli -->|"tracks findings"| node_findings
node_cli -->|"advances lifecycle"| node_workflow
node_workflow -->|"records events"| node_registry
node_cli -->|"renders reports"| node_reports
node_reports -->|"reads evidence"| node_registry
node_cli -->|"exports evidence"| node_export
node_export -->|"reads records"| node_registry
node_mlflow -->|"imports records"| node_registry
node_mlflow -.->|"integrates with"| node_external_mlflow

click node_cli "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/cli.py"
click node_api "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/api.py"
click node_dashboard "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/dashboard/app.py"
click node_dashboard_views "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/dashboard/views.py"
click node_dashboard_client "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/dashboard/client.py"
click node_registry "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/registry/store.py"
click node_domain "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/core/models.py"
click node_classification "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/core/classify.py"
click node_tiering "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/tiering.py"
click node_packs "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/packs/loader.py"
click node_pack_rules "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/packs/resolver.py"
click node_checks "https://github.com/abiroland/AI-MRG-Framework/tree/main/src/aimrg/checks"
click node_check_framework "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/checks/base.py"
click node_findings "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/findings.py"
click node_workflow "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/workflow.py"
click node_reports "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/reports/render.py"
click node_export "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/export.py"
click node_mlflow "https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/integrations/mlflow.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_domain,node_classification,node_tiering,node_workflow toneBlue
class node_packs,node_pack_rules,node_checks,node_check_framework toneAmber
class node_registry,node_findings,node_reports,node_export toneMint
class node_cli,node_api,node_dashboard,node_dashboard_views,node_dashboard_client toneRose
class node_mlflow,node_user,node_external_mlflow toneIndigo
```

## Components

### Governance workflow

- [Governance records](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/core/models.py): `src/aimrg/core/models.py`
- [AI classification](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/core/classify.py): `src/aimrg/core/classify.py`
- [Risk tiering](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/tiering.py): `src/aimrg/tiering.py`
- [Lifecycle gates](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/workflow.py): `src/aimrg/workflow.py`

### Controls and checks

- [Control packs](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/packs/loader.py): `src/aimrg/packs/loader.py`
- [Control applicability](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/packs/resolver.py): `src/aimrg/packs/resolver.py`
- [Checks library](https://github.com/abiroland/AI-MRG-Framework/tree/main/src/aimrg/checks): `src/aimrg/checks`
- [Check framework](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/checks/base.py): `src/aimrg/checks/base.py`

### Records and reporting

- [Governance registry](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/registry/store.py): `src/aimrg/registry/store.py`
- [Findings](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/findings.py): `src/aimrg/findings.py`
- [Governance reports](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/reports/render.py): `src/aimrg/reports/render.py`
- [Evidence export](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/export.py): `src/aimrg/export.py`

### User interfaces

- [Command line](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/cli.py): `src/aimrg/cli.py`
- [REST API](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/api.py): `src/aimrg/api.py`
- [Web dashboard](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/dashboard/app.py): `src/aimrg/dashboard/app.py`
- [Dashboard views](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/dashboard/views.py): `src/aimrg/dashboard/views.py`
- [API client](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/dashboard/client.py): `src/aimrg/dashboard/client.py`

### Integrations

- [MLflow integration](https://github.com/abiroland/AI-MRG-Framework/blob/main/src/aimrg/integrations/mlflow.py): `src/aimrg/integrations/mlflow.py`

### Other components

- **Practitioner**
- **MLflow**

## Connections

- Practitioner → Command line: runs commands (evidence: `README.md`)
- Practitioner → Web dashboard: uses interface (evidence: `README.md`)
- Practitioner → REST API: calls endpoints (evidence: `README.md`)
- Command line → Governance registry: manages records (evidence: `src/aimrg/cli.py`)
- REST API → Governance registry: serves requests (evidence: `src/aimrg/api.py`)
- Web dashboard → Dashboard views: renders views (evidence: `src/aimrg/dashboard/app.py`)
- Web dashboard → API client: uses client (evidence: `src/aimrg/dashboard/app.py`)
- Governance registry → Governance records: validates records (evidence: `src/aimrg/registry/store.py`)
- Command line → AI classification: classifies assets (evidence: `src/aimrg/cli.py`)
- AI classification → Governance records: builds classification (evidence: `src/aimrg/core/classify.py`)
- Command line → Risk tiering: assesses risk (evidence: `README.md`)
- Command line → Control packs: loads controls (evidence: `src/aimrg/cli.py`)
- Control packs → Control applicability: supplies controls (evidence: `src/aimrg/packs/resolver.py`)
- Command line → Checks library: runs checks (evidence: `README.md`)
- Checks library → Check framework: uses framework (evidence: `src/aimrg/checks/__init__.py`)
- Command line → Findings: tracks findings (evidence: `src/aimrg/cli.py`)
- Command line → Lifecycle gates: advances lifecycle (evidence: `README.md`)
- Lifecycle gates → Governance registry: records events (evidence: `src/aimrg/workflow.py`)
- Command line → Governance reports: renders reports (evidence: `README.md`)
- Governance reports → Governance registry: reads evidence (evidence: `src/aimrg/reports/render.py`)
- Command line → Evidence export: exports evidence (evidence: `src/aimrg/cli.py`)
- Evidence export → Governance registry: reads records (evidence: `src/aimrg/export.py`)
- MLflow integration → Governance registry: imports records (evidence: `src/aimrg/integrations/mlflow.py`)
- MLflow integration → MLflow: integrates with (evidence: `README.md`)
