Architecture

image

TGM is organized as a three-layer architecture:

  1. Data Layer

  2. Immutable, time-sorted coordinate-format graph storage with lightweight, concurrency-safe graph views.

  3. Efficient time-based slicing and binary search over timestamps, enabling fast recent-neighbor retrieval.
  4. Supports continuous-time and discrete-time loading, with vectorized snapshot creation.
  5. Extensible backend allows alternative storage layouts for future models.

  6. Execution Layer

  7. The DataLoader is responsible for iterating through the temporal graph data stream by time or events based on the user-defined granularity.

  8. HookManager orchestrates transformations during data loading (e.g., temporal neighbor sampling), dynamically adding relevant attributes to the Batch yielded by the dataloader.
  9. Hooks can be combined and registered under specific conditions (analytics, training, etc.).
  10. Pre-defined recipes simplify common setups (e.g. TGB link prediction) and prevent common pitfalls (e.g., mismanaging negatives).

  11. ML Layer

  12. Materializes batches directly on-device for model computation.

  13. Supports node-, link-, and graph-level prediction.

[!TIP] Check out our paper for technical details.