# logan23info/ai-agentic-rcm architecture

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

- Interactive diagram: https://gitdiagram.com/logan23info/ai-agentic-rcm
- Repository: https://github.com/logan23info/ai-agentic-rcm

## Overview

AI Agentic RCM is a multi-tenant assurance workbench for audit teams assessing Microsoft and Google AI agents. Its main workflow moves from engagement scoping and agent inventory through applicability, evidence collection, TOD/TOI/TOE testing, signed conclusions, findings, QA, and an issued report. Separate product branches support agent design/readiness, client self-assessment, and monitoring control-library changes. The graph combines README-documented workflows with relationships visible in the source index and excerpts; several route and subsystem implementations were not sampled.

Main entry points: [`apps/web/lib/assurance.ts`](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/assurance.ts) (Test conclusions), [`apps/web/lib/workflow.ts`](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/workflow.ts) (Control workpapers), [`apps/web/lib/selfassess/service.ts`](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/selfassess/service.ts) (Self-assessment), [`apps/web/lib/controls.ts`](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/controls.ts) (Pinned control library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_assurance["Assurance engagements"]
  node_engagement_ui["Engagement workspace<br/>[page.tsx]"]
  node_scoping["Scoping<br/>[page.tsx]"]
  node_agent_inventory["Agent inventory<br/>[page.tsx]"]
  node_workpapers["Control workpapers<br/>[workflow.ts]"]
  node_evidence["Evidence<br/>[evidence.ts]"]
  node_assurance_rules["Test conclusions<br/>[assurance.ts]"]
  node_findings["Findings<br/>[findings.ts]"]
  node_qa_report["QA and report<br/>[report.ts]"]
end

subgraph group_governance["Agent governance"]
  node_usecase["Design and readiness<br/>[service.ts]"]
  node_selfassessment["Self-assessment<br/>[service.ts]"]
  node_agent_register["Client agent register<br/>[register.ts]"]
  node_client360["Client 360<br/>[client360.ts]"]
  node_ai_assist["Optional AI drafting"]
end

subgraph group_shared["Shared services"]
  node_control_library["Pinned control library<br/>[controls.ts]"]
  node_licensing["Licence profiles<br/>[licence-profile.ts]"]
  node_access["Role and access rules<br/>[rbac.ts]"]
  node_services["Application services<br/>[services.ts]"]
  node_database[("Tenant database<br/>[index.ts]")]
end

subgraph group_library["Library monitoring"]
  node_watch_ui["Library watch<br/>[page.tsx]"]
  node_watch_service["Feed matching and proposals<br/>[service.ts]"]
  node_watch_cron["Scheduled watch<br/>[route.ts]"]
end

node_audit_team(("Audit team"))
node_client_team(("Client team"))
node_client(("Client users"))

node_audit_team -->|"works in"| node_engagement_ui
node_engagement_ui -->|"sets scope"| node_scoping
node_scoping -->|"informs inventory"| node_agent_inventory
node_agent_inventory -->|"locks applicability"| node_workpapers
node_workpapers -->|"requests evidence"| node_evidence
node_workpapers -->|"records tests"| node_assurance_rules
node_evidence -->|"supports testing"| node_assurance_rules
node_assurance_rules -->|"informs findings"| node_findings
node_findings -->|"feeds QA and issue"| node_qa_report
node_workpapers -->|"uses rules"| node_assurance_rules
node_workpapers -->|"loads controls"| node_control_library
node_usecase -->|"links live agent"| node_agent_register
node_selfassessment -->|"reconciles agents"| node_agent_register
node_selfassessment -->|"computes risk"| node_assurance_rules
node_selfassessment -->|"supports assessment"| node_client_team
node_audit_team -->|"reviews client"| node_client360
node_client360 -->|"validates profile"| node_licensing
node_control_library -->|"defines coverage"| node_licensing
node_ai_assist -.->|"drafts from linked text"| node_evidence
node_ai_assist -.->|"suggests test results"| node_assurance_rules
node_services -->|"authorizes actions"| node_access
node_services -->|"queries data"| node_database
node_database -->|"imports controls"| node_control_library
node_watch_ui -->|"manages watch"| node_watch_service
node_watch_cron -.->|"runs scheduled scan"| node_watch_service
node_watch_service -->|"matches controls"| node_control_library
node_client -->|"self-assesses"| node_selfassessment

click node_engagement_ui "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/app/app/e/%5Bid%5D/page.tsx"
click node_scoping "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/app/app/e/%5Bid%5D/scoping/page.tsx"
click node_agent_inventory "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/app/app/e/%5Bid%5D/agents/page.tsx"
click node_workpapers "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/workflow.ts"
click node_evidence "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/evidence.ts"
click node_assurance_rules "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/assurance.ts"
click node_findings "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/findings.ts"
click node_qa_report "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/export/report.ts"
click node_usecase "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/usecase/service.ts"
click node_selfassessment "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/selfassess/service.ts"
click node_agent_register "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/register.ts"
click node_client360 "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/client360.ts"
click node_ai_assist "https://github.com/logan23info/ai-agentic-rcm/tree/main/apps/web/lib/ai"
click node_control_library "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/controls.ts"
click node_licensing "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/licence-profile.ts"
click node_access "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/rbac.ts"
click node_services "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/services.ts"
click node_database "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/db/index.ts"
click node_watch_ui "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/app/app/library/watch/page.tsx"
click node_watch_service "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/library-watch/service.ts"
click node_watch_cron "https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/app/api/cron/library-watch/route.ts"

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_engagement_ui,node_scoping,node_agent_inventory,node_workpapers,node_evidence,node_assurance_rules,node_findings,node_qa_report,node_client_team,node_client toneBlue
class node_usecase,node_selfassessment,node_agent_register,node_client360,node_ai_assist toneAmber
class node_control_library,node_licensing,node_access,node_services,node_database toneMint
class node_watch_ui,node_watch_service,node_watch_cron toneRose
class node_audit_team toneIndigo
```

## Components

### Assurance engagements

- [Engagement workspace](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/app/app/e/%5Bid%5D/page.tsx): `apps/web/app/app/e/[id]/page.tsx`
- [Scoping](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/app/app/e/%5Bid%5D/scoping/page.tsx): `apps/web/app/app/e/[id]/scoping/page.tsx`
- [Agent inventory](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/app/app/e/%5Bid%5D/agents/page.tsx): `apps/web/app/app/e/[id]/agents/page.tsx`
- [Control workpapers](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/workflow.ts): `apps/web/lib/workflow.ts`
- [Evidence](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/evidence.ts): `apps/web/lib/evidence.ts`
- [Test conclusions](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/assurance.ts): `apps/web/lib/assurance.ts`
- [Findings](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/findings.ts): `apps/web/lib/findings.ts`
- [QA and report](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/export/report.ts): `apps/web/lib/export/report.ts`

### Agent governance

- [Design and readiness](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/usecase/service.ts): `apps/web/lib/usecase/service.ts`
- [Self-assessment](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/selfassess/service.ts): `apps/web/lib/selfassess/service.ts`
- [Client agent register](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/register.ts): `apps/web/lib/register.ts`
- [Client 360](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/client360.ts): `apps/web/lib/client360.ts`
- [Optional AI drafting](https://github.com/logan23info/ai-agentic-rcm/tree/main/apps/web/lib/ai): `apps/web/lib/ai`

### Shared services

- [Pinned control library](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/controls.ts): `apps/web/lib/controls.ts`
- [Licence profiles](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/licence-profile.ts): `apps/web/lib/licence-profile.ts`
- [Role and access rules](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/rbac.ts): `apps/web/lib/rbac.ts`
- [Application services](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/services.ts): `apps/web/lib/services.ts`
- [Tenant database](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/db/index.ts): `apps/web/lib/db/index.ts`

### Library monitoring

- [Library watch](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/app/app/library/watch/page.tsx): `apps/web/app/app/library/watch/page.tsx`
- [Feed matching and proposals](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/lib/library-watch/service.ts): `apps/web/lib/library-watch/service.ts`
- [Scheduled watch](https://github.com/logan23info/ai-agentic-rcm/blob/main/apps/web/app/api/cron/library-watch/route.ts): `apps/web/app/api/cron/library-watch/route.ts`

### Other components

- **Audit team**
- **Client team**
- **Client users**

## Connections

- Audit team → Engagement workspace: works in
- Engagement workspace → Scoping: sets scope
- Scoping → Agent inventory: informs inventory
- Agent inventory → Control workpapers: locks applicability
- Control workpapers → Evidence: requests evidence
- Control workpapers → Test conclusions: records tests (evidence: `apps/web/lib/workflow.ts`)
- Evidence → Test conclusions: supports testing
- Test conclusions → Findings: informs findings
- Findings → QA and report: feeds QA and issue
- Control workpapers → Test conclusions: uses rules (evidence: `apps/web/lib/workflow.ts`)
- Control workpapers → Pinned control library: loads controls (evidence: `apps/web/lib/workflow.ts`)
- Design and readiness → Client agent register: links live agent (evidence: `apps/web/lib/usecase/service.ts`)
- Self-assessment → Client agent register: reconciles agents (evidence: `apps/web/lib/register.ts`)
- Self-assessment → Test conclusions: computes risk (evidence: `apps/web/lib/selfassess/service.ts`)
- Self-assessment → Client team: supports assessment
- Audit team → Client 360: reviews client
- Client 360 → Licence profiles: validates profile (evidence: `apps/web/lib/client360.ts`)
- Pinned control library → Licence profiles: defines coverage (evidence: `apps/web/lib/licence-profile.ts`)
- Optional AI drafting → Evidence: drafts from linked text
- Optional AI drafting → Test conclusions: suggests test results
- Application services → Role and access rules: authorizes actions (evidence: `apps/web/lib/services.ts`)
- Application services → Tenant database: queries data (evidence: `apps/web/lib/services.ts`)
- Tenant database → Pinned control library: imports controls (evidence: `apps/web/lib/db/index.ts`)
- Library watch → Feed matching and proposals: manages watch (evidence: `apps/web/lib/library-watch/service.ts`)
- Scheduled watch → Feed matching and proposals: runs scheduled scan
- Feed matching and proposals → Pinned control library: matches controls (evidence: `apps/web/lib/library-watch/service.ts`)
- Client users → Self-assessment: self-assesses
