# ml-ml/link-moe architecture

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

- Interactive diagram: https://gitdiagram.com/ml-ml/link-moe
- Repository: https://github.com/ml-ml/link-moe

## Overview

Link-MoE combines pretrained link-prediction scores with graph and heuristic features, then trains a scoring model and reports link-prediction metrics. The README describes base-score and heuristic generation as prerequisite workflows performed with HeaRT; those generators are not present in this repository. The sampled code shows feature construction, training/testing helpers, and metric evaluation. Some wiring in main.py was omitted from the excerpt, so the graph avoids inferring those calls.

Main entry points: [`main.py`](https://github.com/ml-ml/link-moe/blob/main/main.py) (Experiment pipeline), [`utils.py`](https://github.com/ml-ml/link-moe/blob/main/utils.py) (Run utilities), [`evaluators.py`](https://github.com/ml-ml/link-moe/blob/main/evaluators.py) (Ranking metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Inputs and orchestration"]
  node_base_scores["Base-model scores"]
  node_heuristics["Heuristic features"]
  node_runner["Experiment pipeline<br/>[main.py]"]
  node_feature_prep["Feature assembly<br/>[main.py]"]
  node_training["MoE training and testing<br/>[main.py]"]
  node_utilities["Run utilities<br/>[utils.py]"]
end

subgraph group_models["Scoring models"]
  node_gnn_models["GNN and MLP models<br/>[gnn_model.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_metrics["Ranking metrics<br/>[evaluators.py]"]
end

node_user(("Experiment runner"))
node_heart["HeaRT workflows"]

node_user -->|"runs"| node_runner
node_heart -->|"generates"| node_base_scores
node_heart -->|"generates"| node_heuristics
node_base_scores -->|"supplies scores"| node_runner
node_heuristics -->|"supplies features"| node_runner
node_runner -->|"builds features"| node_feature_prep
node_runner -->|"initializes seed"| node_utilities
node_runner -->|"evaluates hits"| node_metrics

click node_runner "https://github.com/ml-ml/link-moe/blob/main/main.py"
click node_feature_prep "https://github.com/ml-ml/link-moe/blob/main/main.py"
click node_training "https://github.com/ml-ml/link-moe/blob/main/main.py"
click node_gnn_models "https://github.com/ml-ml/link-moe/blob/main/gnn_model.py"
click node_metrics "https://github.com/ml-ml/link-moe/blob/main/evaluators.py"
click node_utilities "https://github.com/ml-ml/link-moe/blob/main/utils.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_base_scores,node_heuristics,node_runner,node_feature_prep,node_training,node_utilities toneBlue
class node_gnn_models toneAmber
class node_metrics toneMint
class node_user,node_heart toneIndigo
```

## Components

### Inputs and orchestration

- **Base-model scores**
- **Heuristic features**
- [Experiment pipeline](https://github.com/ml-ml/link-moe/blob/main/main.py): `main.py`
- [Feature assembly](https://github.com/ml-ml/link-moe/blob/main/main.py): `main.py`
- [MoE training and testing](https://github.com/ml-ml/link-moe/blob/main/main.py): `main.py`
- [Run utilities](https://github.com/ml-ml/link-moe/blob/main/utils.py): `utils.py`

### Scoring models

- [GNN and MLP models](https://github.com/ml-ml/link-moe/blob/main/gnn_model.py): `gnn_model.py`

### Evaluation

- [Ranking metrics](https://github.com/ml-ml/link-moe/blob/main/evaluators.py): `evaluators.py`

### Other components

- **Experiment runner**
- **HeaRT workflows**

## Connections

- Experiment runner → Experiment pipeline: runs (evidence: `README.md`)
- HeaRT workflows → Base-model scores: generates (evidence: `README.md`)
- HeaRT workflows → Heuristic features: generates (evidence: `README.md`)
- Base-model scores → Experiment pipeline: supplies scores (evidence: `README.md`)
- Heuristic features → Experiment pipeline: supplies features (evidence: `README.md`)
- Experiment pipeline → Feature assembly: builds features (evidence: `main.py`)
- Experiment pipeline → Run utilities: initializes seed (evidence: `main.py`)
- Experiment pipeline → Ranking metrics: evaluates hits (evidence: `main.py`)
