-
Locate the sf-mleu-solutions repository:
- Check current working directory
- If not found:
git clone https://github.com/Snowflake-Labs/sf-mleu-solutions.git /tmp/sf-mleu-solutions
-
Read solutions/gnn-supply-chain-risk/manifest.json.
-
Query the current account info and present the installation plan:
SELECT CURRENT_ORGANIZATION_NAME() AS ORG, CURRENT_ACCOUNT_NAME() AS ACCOUNT, CURRENT_REGION() AS REGION, CURRENT_ROLE() AS ROLE;
Show to the user:
Solution: GNN Supply Chain Risk Intelligence v1.0.0
Industry: Manufacturing
Database: SF_SOLUTIONS
Schema: GNN_SUPPLY_CHAIN_RISK
Role: ACCOUNTADMIN
Target Account:
Organization: <ORG>
Account: <ACCOUNT>
Region: <REGION>
Current Role: <ROLE>
What will be created:
- 9 tables (VENDORS, MATERIALS, PURCHASE_ORDERS, BILL_OF_MATERIALS, TRADE_DATA, REGIONS, RISK_SCORES, PREDICTED_LINKS, BOTTLENECKS)
- Demo data (~378 rows: 50 vendors, 26 materials, 120 POs, 150 trade records, 9 regions)
- 4 analytics views
- ANALYZE_RISK_SCENARIO SQL UDF
- Semantic model (staged YAML for Cortex Analyst)
- Cortex Agent (SUPPLY_CHAIN_RISK_AGENT)
- RUN_RISK_SCORING stored procedure (NetworkX, no GPU required)
- [Optional] GPU Compute Pool + External Access Integration (for PyTorch Geometric notebook)
Proceed with installation?
-
Wait for user confirmation.
-
Read solutions/gnn-supply-chain-risk/scripts/setup.sql and execute in BATCHES:
Batch 1 — Infrastructure (Section 1-2):
USE ROLE ACCOUNTADMIN;
CREATE DATABASE IF NOT EXISTS SF_SOLUTIONS;
CREATE SCHEMA IF NOT EXISTS SF_SOLUTIONS.GNN_SUPPLY_CHAIN_RISK;
USE DATABASE SF_SOLUTIONS;
USE SCHEMA GNN_SUPPLY_CHAIN_RISK;
CREATE WAREHOUSE IF NOT EXISTS SF_SOLUTIONS_WH WAREHOUSE_SIZE='LARGE' AUTO_SUSPEND=60 AUTO_RESUME=TRUE;
USE WAREHOUSE SF_SOLUTIONS_WH;
Then create stages (MODELS_STAGE, DATA_STAGE, SEMANTIC_MODELS).
Batch 2 — Table DDL (Section 3):
Execute all CREATE TABLE statements (VENDORS, MATERIALS, PURCHASE_ORDERS, BILL_OF_MATERIALS, TRADE_DATA, REGIONS + output tables RISK_SCORES, PREDICTED_LINKS, BOTTLENECKS).
Batch 3 — Demo Data (Sections 4-9):
Execute INSERT statements for VENDORS, MATERIALS, REGIONS, BILL_OF_MATERIALS, PURCHASE_ORDERS, TRADE_DATA.
Use timeout_seconds: 300.
Batch 4 — Analytics Views + UDF (Sections 10-11):
Execute CREATE VIEW and CREATE FUNCTION statements.
Batch 5 — Semantic Model (Section 12):
Upload the semantic model YAML to stage. The YAML is inline in setup.sql — execute the PUT/copy statements from the script.
Batch 6 — SPCS + EAI (Sections 13-14, OPTIONAL):
Ask the user: "Do you want to create the GPU Compute Pool and External Access Integration? (Required for PyTorch Geometric notebook, NOT required for stored procedure risk scoring)"
- If yes: execute Sections 13-14
- If no: skip
Batch 7 — Cortex Agent + Stored Procedure + Verification (Sections 15-17):
CREATE OR REPLACE AGENT SF_SOLUTIONS.GNN_SUPPLY_CHAIN_RISK.SUPPLY_CHAIN_RISK_AGENT ...;
CREATE OR REPLACE PROCEDURE SF_SOLUTIONS.GNN_SUPPLY_CHAIN_RISK.RUN_RISK_SCORING() ...;
-
Run the risk scoring stored procedure to populate output tables:
CALL SF_SOLUTIONS.GNN_SUPPLY_CHAIN_RISK.RUN_RISK_SCORING();
Use timeout_seconds: 600.
-
[MANDATORY — DO NOT SKIP] Retrieve and display the agent URL:
SELECT
'https://app.snowflake.com/' || LOWER(CURRENT_ORGANIZATION_NAME()) || '/' || LOWER(CURRENT_ACCOUNT_NAME())
|| '/#/agents/database/SF_SOLUTIONS/schema/GNN_SUPPLY_CHAIN_RISK/agent/SUPPLY_CHAIN_RISK_AGENT/details' AS AGENT_URL;
Display to the user:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Supply Chain Risk Agent:
<AGENT_URL>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This step is NON-OPTIONAL. The user must always see clickable URLs after install.
-
Show final summary:
Installation complete: GNN Supply Chain Risk Intelligence v1.0.0
Risk scoring completed — RISK_SCORES, PREDICTED_LINKS, and BOTTLENECKS tables populated.
Next Actions:
1. Open Snowsight > AI & ML > Agents > SUPPLY_CHAIN_RISK_AGENT
2. Try: "What is our overall portfolio risk?"
3. Try: "Which regions have the highest supply chain risk?"
4. Try: "Simulate a vendor failure for V10006"
Teardown: $sf-mleu-solutions:gnn-supply-chain-risk teardown