# navyasri12355/agentic-aml-system architecture

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

- Interactive diagram: https://gitdiagram.com/navyasri12355/agentic-aml-system
- Repository: https://github.com/navyasri12355/agentic-aml-system

## Overview

This is an AML investigation product: an analyst submits an account (and optionally transaction data), the service detects suspicious activity, analyzes its transaction network and patterns, scores and routes risk, then returns an investigation result and, for applicable cases, a SAR narrative. The browser presents the result as status, risk, network, and narrative views. The README documents batch investigations and Phase 1–4 capabilities; some implementation details are unsampled, so those branches are shown only where documented, without inferring internal calls.

Main entry points: [`src/orchestration/graph.py`](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/orchestration/graph.py) (Investigation workflow), [`frontend/src/pages/Investigate.jsx`](https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/pages/Investigate.jsx) (Investigation page), [`src/orchestration/run.py`](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/orchestration/run.py) (Orchestration runner), [`frontend/src/store/useInvestigationStore.js`](https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/store/useInvestigationStore.js) (Investigation state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Analyst interface"]
  node_investigate_page["Investigation page<br/>[Investigate.jsx]"]
  node_investigation_store["Investigation state"]
  node_api_client["API client<br/>[client.js]"]
  node_status_view["Status tracker<br/>[StatusTracker.jsx]"]
  node_risk_view["Risk gauge<br/>[RiskGauge.jsx]"]
  node_network_view["Network visualization<br/>[NetworkGraph.jsx]"]
  node_narrative_view["Narrative panel<br/>[NarrativeBox.jsx]"]
end

subgraph group_service["Investigation service"]
  node_api_service["FastAPI service<br/>[main.py]"]
  node_runner["Orchestration runner<br/>[run.py]"]
  node_workflow["Investigation workflow<br/>[graph.py]"]
  node_workflow_state["Investigation state<br/>[state.py]"]
end

subgraph group_analysis["AML analysis"]
  node_ingestion["Transaction preparation<br/>[data_ingestion.py]"]
  node_detection["Anomaly detection<br/>[detection_agent.py]"]
  node_graph_agent["Network construction<br/>[graph_agent.py]"]
  node_features["Feature extraction<br/>[feature_agent.py]"]
  node_patterns["Pattern detection<br/>[pattern_agent.py]"]
  node_global_stats["Global statistics<br/>[global_stats.py]"]
end

subgraph group_reporting["Risk and reporting"]
  node_risk["Risk scoring<br/>[risk_agent.py]"]
  node_explanation["SAR generation"]
end

node_analyst(("Analyst"))

node_analyst -->|"submits case"| node_investigate_page
node_investigate_page -->|"updates state"| node_investigation_store
node_investigation_store -->|"requests investigation"| node_api_client
node_api_client -->|"posts account"| node_api_service
node_api_service -->|"creates runner"| node_runner
node_runner -->|"executes workflow"| node_workflow
node_workflow -->|"loads transactions"| node_ingestion
node_workflow -->|"detects anomalies"| node_detection
node_workflow -->|"builds subgraph"| node_graph_agent
node_workflow -->|"extracts features"| node_features
node_workflow -->|"detects patterns"| node_patterns
node_workflow -->|"scores and routes"| node_risk
node_workflow -->|"generates report"| node_explanation
node_workflow -->|"uses statistics"| node_global_stats
node_runner -->|"maintains state"| node_workflow_state
node_investigate_page -->|"renders"| node_status_view
node_investigate_page -->|"renders"| node_risk_view
node_investigate_page -->|"renders"| node_network_view
node_investigate_page -->|"renders"| node_narrative_view
node_explanation -.->|"returns SAR narrative"| node_analyst

click node_investigate_page "https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/pages/Investigate.jsx"
click node_investigation_store "https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/store/useInvestigationStore.js"
click node_api_client "https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/api/client.js"
click node_api_service "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/api/main.py"
click node_runner "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/orchestration/run.py"
click node_workflow "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/orchestration/graph.py"
click node_workflow_state "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/orchestration/state.py"
click node_ingestion "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/pipeline/data_ingestion.py"
click node_detection "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/detection_agent.py"
click node_graph_agent "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/graph_agent.py"
click node_features "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/feature_agent.py"
click node_patterns "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/pattern_agent.py"
click node_global_stats "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/utils/global_stats.py"
click node_risk "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/risk_agent.py"
click node_explanation "https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/explanation_agent.py"
click node_status_view "https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/components/investigation/StatusTracker.jsx"
click node_risk_view "https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/components/investigation/RiskGauge.jsx"
click node_network_view "https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/components/investigation/NetworkGraph.jsx"
click node_narrative_view "https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/components/investigation/NarrativeBox.jsx"

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_investigate_page,node_investigation_store,node_api_client,node_status_view,node_risk_view,node_network_view,node_narrative_view toneBlue
class node_api_service,node_runner,node_workflow,node_workflow_state toneAmber
class node_ingestion,node_detection,node_graph_agent,node_features,node_patterns,node_global_stats toneMint
class node_risk,node_explanation toneRose
class node_analyst toneIndigo
```

## Components

### Analyst interface

- [Investigation page](https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/pages/Investigate.jsx): `frontend/src/pages/Investigate.jsx`
- [Investigation state](https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/store/useInvestigationStore.js): `frontend/src/store/useInvestigationStore.js`
- [API client](https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Status tracker](https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/components/investigation/StatusTracker.jsx): `frontend/src/components/investigation/StatusTracker.jsx`
- [Risk gauge](https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/components/investigation/RiskGauge.jsx): `frontend/src/components/investigation/RiskGauge.jsx`
- [Network visualization](https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/components/investigation/NetworkGraph.jsx): `frontend/src/components/investigation/NetworkGraph.jsx`
- [Narrative panel](https://github.com/navyasri12355/agentic-aml-system/blob/main/frontend/src/components/investigation/NarrativeBox.jsx): `frontend/src/components/investigation/NarrativeBox.jsx`

### Investigation service

- [FastAPI service](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/api/main.py): `src/api/main.py`
- [Orchestration runner](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/orchestration/run.py): `src/orchestration/run.py`
- [Investigation workflow](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/orchestration/graph.py): `src/orchestration/graph.py`
- [Investigation state](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/orchestration/state.py): `src/orchestration/state.py`

### AML analysis

- [Transaction preparation](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/pipeline/data_ingestion.py): `src/pipeline/data_ingestion.py`
- [Anomaly detection](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/detection_agent.py): `src/agents/detection_agent.py`
- [Network construction](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/graph_agent.py): `src/agents/graph_agent.py`
- [Feature extraction](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/feature_agent.py): `src/agents/feature_agent.py`
- [Pattern detection](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/pattern_agent.py): `src/agents/pattern_agent.py`
- [Global statistics](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/utils/global_stats.py): `src/utils/global_stats.py`

### Risk and reporting

- [Risk scoring](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/risk_agent.py): `src/agents/risk_agent.py`
- [SAR generation](https://github.com/navyasri12355/agentic-aml-system/blob/main/src/agents/explanation_agent.py): `src/agents/explanation_agent.py`

### Other components

- **Analyst**

## Connections

- Analyst → Investigation page: submits case
- Investigation page → Investigation state: updates state (evidence: `frontend/src/pages/Investigate.jsx`)
- Investigation state → API client: requests investigation (evidence: `frontend/src/store/useInvestigationStore.js`)
- API client → FastAPI service: posts account (evidence: `frontend/src/api/client.js`)
- FastAPI service → Orchestration runner: creates runner (evidence: `src/api/main.py`)
- Orchestration runner → Investigation workflow: executes workflow (evidence: `src/orchestration/run.py`)
- Investigation workflow → Transaction preparation: loads transactions (evidence: `src/orchestration/graph.py`)
- Investigation workflow → Anomaly detection: detects anomalies (evidence: `src/orchestration/graph.py`)
- Investigation workflow → Network construction: builds subgraph (evidence: `src/orchestration/graph.py`)
- Investigation workflow → Feature extraction: extracts features (evidence: `src/orchestration/graph.py`)
- Investigation workflow → Pattern detection: detects patterns (evidence: `src/orchestration/graph.py`)
- Investigation workflow → Risk scoring: scores and routes (evidence: `src/orchestration/graph.py`)
- Investigation workflow → SAR generation: generates report (evidence: `src/orchestration/graph.py`)
- Investigation workflow → Global statistics: uses statistics (evidence: `src/orchestration/graph.py`)
- Orchestration runner → Investigation state: maintains state (evidence: `src/orchestration/run.py`)
- Investigation page → Status tracker: renders (evidence: `frontend/src/pages/Investigate.jsx`)
- Investigation page → Risk gauge: renders (evidence: `frontend/src/pages/Investigate.jsx`)
- Investigation page → Network visualization: renders (evidence: `frontend/src/pages/Investigate.jsx`)
- Investigation page → Narrative panel: renders (evidence: `frontend/src/pages/Investigate.jsx`)
- SAR generation → Analyst: returns SAR narrative
