RepoSnowflake (Arctic)Snowflake (Arctic)published Mar 12, 2026seen 5d

Snowflake-Labs/sfguide-supply-chain-risk-intelligence-with-snowflake

Python

Open original ↗

Captured source

source ↗

Snowflake-Labs/sfguide-supply-chain-risk-intelligence-with-snowflake

Description: AI-driven N-tier supply chain risk analysis using Graph Neural Networks on Snowflake. Detects hidden bottlenecks and predicts Tier-2+ supplier relationships via an interactive Streamlit dashboard.

Language: Python

License: Apache-2.0

Stars: 1

Forks: 1

Open issues: 0

Created: 2026-03-12T17:29:03Z

Pushed: 2026-03-24T19:37:00Z

Default branch: main

Fork: no

Archived: no

README:

Supply Chain Risk Intelligence for Manufacturing: Achieve N-Tier Visibility with Snowflake

Detect unknown supply chain vulnerabilities using Graph Neural Networks (PyTorch Geometric) on Snowflake with GPU-accelerated notebooks, Cortex Agent, and a multi-page Streamlit dashboard.

What You Will Build

  • A GPU-accelerated notebook that trains a GraphSAGE model on supply chain data
  • Risk scores propagated through multi-tier supplier networks
  • Predicted unknown Tier-2+ dependencies via link prediction
  • Identified bottlenecks and single points of failure
  • A Cortex Agent for natural language supply chain queries
  • A multi-page Streamlit dashboard for risk visualization and mitigation planning

What You Will Learn

  • How to train Graph Neural Networks using PyTorch Geometric in Snowflake Notebooks
  • How to use GPU compute pools for ML workloads
  • How to create a Cortex Agent with semantic models
  • How to build multi-page Streamlit dashboards in Snowflake
  • How to apply GNN techniques (message passing, link prediction) to supply chain risk

Prerequisites

  • Snowflake account with ACCOUNTADMIN role
  • Cortex AI features enabled

For GPU Notebook (Option A):

  • GPU compute pool support (GPU_NV_S instance family)
  • External Access Integration support (not available on trial accounts)

For NetworkX Notebook (Option B):

  • No additional requirements — works on any Snowflake account

Quick Start

Step 1: Run Setup

1. Open Snowsight: ProjectsWorksheets 2. Click + to create a new SQL worksheet 3. Choose your path:

4. Paste and click Run All

Step 2: Run a Notebook

Two notebook options are available:

Option A: GPU Notebook (Full GNN — requires EAI)

1. Navigate: ProjectsNotebooksSUPPLY_CHAIN_RISK_GNN_NOTEBOOK 2. Set your role to SUPPLY_CHAIN_RISK_ROLE (top-right role selector) 3. Click Run All

The GPU notebook will:

  • Install PyTorch Geometric + cuGraph via pip (requires External Access Integration)
  • Build a heterogeneous graph from ERP and trade data
  • Train a GraphSAGE model for risk propagation and link prediction
  • Run GPU-accelerated graph analytics (PageRank, Louvain, betweenness)
  • Write results to RISK_SCORES, PREDICTED_LINKS, and BOTTLENECKS tables (GNN schema)

Option B: NetworkX Notebook (No EAI required)

1. Navigate: ProjectsNotebooksSUPPLY_CHAIN_RISK_NX_NOTEBOOK 2. Set your role to SUPPLY_CHAIN_RISK_ROLE (top-right role selector) 3. Click Run All

The NetworkX notebook will:

  • Use only Snowflake conda channel packages (no external access)
  • Run CPU-based graph analytics (PageRank, Louvain, betweenness)
  • Use Jaccard similarity for link prediction (instead of GNN)
  • Write results to NX_RISK_SCORES, NX_PREDICTED_LINKS, and NX_BOTTLENECKS tables (NX schema)

> Note: Each notebook writes to its own output tables. Compatibility views (_GNN and _NX suffixed) normalize the schemas so each Streamlit app works with its respective notebook output.

Step 3: Access the Dashboard

> Note: Run a notebook first (Step 2) to populate risk scores, predicted links, and bottlenecks. The dashboard will show empty data without notebook execution.

Navigate: ProjectsStreamlitGNN_SUPPLY_CHAIN_RISK_APP (GNN path) or NX_SUPPLY_CHAIN_RISK_APP (NetworkX path)

| Page | Description | |------|-------------| | Executive Summary | High-level risk overview with KPIs and health score | | Exploratory Analysis | Deep-dive into vendor and material risk distributions | | Supply Network | Interactive graph visualization of the supply chain | | Tier 2 Analysis | Predicted unknown dependencies and evidence strength | | Scenario Simulator | What-if analysis for regional disruptions and vendor failures | | Command Center | Cortex Agent chat for natural language risk queries | | Risk Mitigation | Prioritized action items and mitigation strategies | | About | Architecture and methodology documentation |

Step 4: Chat with the Agent

Navigate: Snowflake IntelligenceSUPPLY_CHAIN_GNN_AGENT (GNN) or SUPPLY_CHAIN_NX_AGENT (NetworkX)

The agent comes with preconfigured sample prompts. Try questions like:

What is our overall portfolio risk score?
Which suppliers have critical risk and where are they located?
Show me the top 5 bottlenecks by impact score
What is the average risk score by country?
Which regions have the highest geopolitical risk?
What would happen if there was a disruption in China?
Simulate a vendor failure for V10001 with high severity
What if Australia had a major natural disaster — which suppliers are affected?
Run a portfolio summary and tell me our overall health score
What is the projected risk if we lose all suppliers in South Korea?

Synthetic Data Generation

Setup generates realistic supply chain data automatically via a Snowpark Python stored procedure — no CSVs or external files required. Both setup scripts call GENERATE_SYNTHETIC_DATA(42), which creates:

| Table | Description | |-------|-------------| | REGIONS | Global manufacturing regions with geopolitical risk scores and regulatory complexity | | VENDORS | Tiered suppliers (Tier-1/2/3) across 7 categories: electronics, chemicals, metals, automotive, semiconductor, logistics, raw materials | | MATERIALS | Finished goods, semi-finished, and raw materials with criticality ratings | | BILL_OF_MATERIALS | Multi-level BOM relationships linking finished → semi-finished → raw materials | | PURCHASE_ORDERS | Vendor-material orders…

Excerpt shown — open the source for the full document.

Notability

notability 1.0/10

Low traction guide repo