# bmifsud/dtcch-2025-openaml architecture

> Architecture diagram of the GitHub repository bmifsud/dtcch-2025-openaml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bmifsud/dtcch-2025-openaml
- Repository: https://github.com/bmifsud/dtcch-2025-openaml

## Overview

OpenAML is a research platform for on-chain AML: it ingests blockchain and reference data, derives wallet/transaction features, applies risk classification, and presents investigative results. The tree also contains OpenKYT, an LLM-based blockchain analytics interface, and FINOS graph, indexing, and sanctions modules. The graph preserves these as related product branches without assuming they are wired together. Some documented capabilities—such as multi-hop taint analysis, compliance reporting, and model families—are not represented by sampled runtime source paths, so their internal flows are omitted.

Main entry points: [`OpenKYT/frontend/src/App.tsx`](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/frontend/src/App.tsx) (Investigation Chat), [`OpenKYT/backend/api/main.py`](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/api/main.py) (API Routes), [`Project_DTCC_AI_Hackathon/app.py`](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/app.py) (Prediction API), [`OpenKYT/backend/rag/ingest_text.py`](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/rag/ingest_text.py) (Knowledge Ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_openkyt["OpenKYT Analytics"]
  node_chat_ui["Investigation Chat<br/>[App.tsx]"]
  node_api["API Routes<br/>[main.py]"]
  node_analysis["Analysis Runner<br/>[run_analysis.py]"]
  node_analysis_tools["Analysis Tools<br/>[tools.py]"]
  node_history["Analysis History<br/>[history.py]"]
  node_rag_ingest["Knowledge Ingestion<br/>[ingest_text.py]"]
  node_clickhouse[("ClickHouse<br/>[clickhouse.py]")]
  node_waitlist["Waitlist Handler<br/>[waitlist.py]"]
end

subgraph group_prototype["DTCC Prototype"]
  node_processor["Data Processor"]
  node_transaction_reader["CSV Transaction Loader"]
  node_processor_db[("Processor Database<br/>[db.ts]")]
  node_features["Training Features"]
  node_training_table["Training Table"]
  node_training_export["Training Export"]
  node_prediction_api["Prediction API<br/>[app.py]"]
  node_dashboard["Risk Dashboard<br/>[App.jsx]"]
end

subgraph group_finos["FINOS On-chain"]
  node_rpc_indexer["RPC Indexer<br/>[rpc_indexer.ts]"]
  node_graph_builder["Graph Builder<br/>[builder.ts]"]
  node_graph_traversal["Graph Traversal<br/>[traversal.ts]"]
  node_sanctions["Sanction Loader<br/>[sanction_loader.ts]"]
end

subgraph group_ml["AML Modeling"]
  node_modeling["Model Training<br/>[random_forest.py]"]
end

node_analyst(("Analyst"))
node_ollama["Ollama"]

node_analyst -->|"asks"| node_chat_ui
node_chat_ui -->|"posts analysis"| node_api
node_api -->|"streams analysis"| node_analysis
node_api -->|"submits email"| node_waitlist
node_analysis -->|"uses tools"| node_analysis_tools
node_chat_ui --> node_prediction_api
node_rag_ingest -->|"requests embeddings"| node_ollama
node_rag_ingest -->|"inserts chunks"| node_clickhouse
node_transaction_reader -->|"writes transactions"| node_processor_db
node_analyst -->|"requests scoring"| node_prediction_api
node_prediction_api -.->|"loads trained model"| node_modeling
node_analyst -->|"views risk"| node_dashboard

click node_chat_ui "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/frontend/src/App.tsx"
click node_api "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/api/main.py"
click node_analysis "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/api/run_analysis.py"
click node_analysis_tools "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/api/tools.py"
click node_history "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/api/history.py"
click node_rag_ingest "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/rag/ingest_text.py"
click node_clickhouse "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/rag/lib/clickhouse.py"
click node_waitlist "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/api/waitlist.py"
click node_processor "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/src/fetch_block_transactions.ts"
click node_transaction_reader "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/src/read_bigquery_transactions.ts"
click node_processor_db "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/lib/db.ts"
click node_features "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/src/training_table_extra_features.ts"
click node_training_table "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/src/create_training_table.ts"
click node_training_export "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/src/export_training_file.ts"
click node_prediction_api "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/app.py"
click node_dashboard "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/site-sentinel/src/App.jsx"
click node_rpc_indexer "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/src/finos/ingestion/rpc_indexer.ts"
click node_graph_builder "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/src/finos/graph/builder.ts"
click node_graph_traversal "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/src/finos/graph/traversal.ts"
click node_sanctions "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/src/finos/tagging/sanction_loader.ts"
click node_modeling "https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/utils/random_forest.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_chat_ui,node_api,node_analysis,node_analysis_tools,node_history,node_rag_ingest,node_clickhouse,node_waitlist toneBlue
class node_processor,node_transaction_reader,node_processor_db,node_features,node_training_table,node_training_export,node_prediction_api,node_dashboard toneAmber
class node_rpc_indexer,node_graph_builder,node_graph_traversal,node_sanctions toneMint
class node_modeling toneRose
class node_analyst,node_ollama toneIndigo
```

## Components

### OpenKYT Analytics

- [Investigation Chat](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/frontend/src/App.tsx): `OpenKYT/frontend/src/App.tsx`
- [API Routes](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/api/main.py): `OpenKYT/backend/api/main.py`
- [Analysis Runner](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/api/run_analysis.py): `OpenKYT/backend/api/run_analysis.py`
- [Analysis Tools](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/api/tools.py): `OpenKYT/backend/api/tools.py`
- [Analysis History](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/api/history.py): `OpenKYT/backend/api/history.py`
- [Knowledge Ingestion](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/rag/ingest_text.py): `OpenKYT/backend/rag/ingest_text.py`
- [ClickHouse](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/rag/lib/clickhouse.py): `OpenKYT/backend/rag/lib/clickhouse.py`
- [Waitlist Handler](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/OpenKYT/backend/api/waitlist.py): `OpenKYT/backend/api/waitlist.py`

### DTCC Prototype

- [Data Processor](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/src/fetch_block_transactions.ts): `Project_DTCC_AI_Hackathon/data-pipeline/processor/src/fetch_block_transactions.ts`
- [CSV Transaction Loader](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/src/read_bigquery_transactions.ts): `Project_DTCC_AI_Hackathon/data-pipeline/processor/src/read_bigquery_transactions.ts`
- [Processor Database](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/lib/db.ts): `Project_DTCC_AI_Hackathon/data-pipeline/processor/lib/db.ts`
- [Training Features](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/src/training_table_extra_features.ts): `Project_DTCC_AI_Hackathon/data-pipeline/processor/src/training_table_extra_features.ts`
- [Training Table](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/src/create_training_table.ts): `Project_DTCC_AI_Hackathon/data-pipeline/processor/src/create_training_table.ts`
- [Training Export](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/data-pipeline/processor/src/export_training_file.ts): `Project_DTCC_AI_Hackathon/data-pipeline/processor/src/export_training_file.ts`
- [Prediction API](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/app.py): `Project_DTCC_AI_Hackathon/app.py`
- [Risk Dashboard](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/site-sentinel/src/App.jsx): `Project_DTCC_AI_Hackathon/site-sentinel/src/App.jsx`

### FINOS On-chain

- [RPC Indexer](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/src/finos/ingestion/rpc_indexer.ts): `src/finos/ingestion/rpc_indexer.ts`
- [Graph Builder](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/src/finos/graph/builder.ts): `src/finos/graph/builder.ts`
- [Graph Traversal](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/src/finos/graph/traversal.ts): `src/finos/graph/traversal.ts`
- [Sanction Loader](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/src/finos/tagging/sanction_loader.ts): `src/finos/tagging/sanction_loader.ts`

### AML Modeling

- [Model Training](https://github.com/bmifsud/dtcch-2025-openaml/blob/main/Project_DTCC_AI_Hackathon/utils/random_forest.py): `Project_DTCC_AI_Hackathon/utils/random_forest.py`

### Other components

- **Analyst**
- **Ollama**

## Connections

- Analyst → Investigation Chat: asks
- Investigation Chat → API Routes: posts analysis
- API Routes → Analysis Runner: streams analysis
- API Routes → Waitlist Handler: submits email
- Analysis Runner → Analysis Tools: uses tools
- Investigation Chat → Prediction API
- Knowledge Ingestion → Ollama: requests embeddings
- Knowledge Ingestion → ClickHouse: inserts chunks
- CSV Transaction Loader → Processor Database: writes transactions
- Analyst → Prediction API: requests scoring
- Prediction API → Model Training: loads trained model
- Analyst → Risk Dashboard: views risk
