This guide walks you through running KumoRFM inside Snowflake Notebooks. Your data never leaves Snowflake -you connect, build a graph, and make predictions all from within a notebook. By the end of this guide you will:Documentation Index
Fetch the complete documentation index at: https://kumo.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
- Create a Snowflake Notebook and connect it to a compute pool
- Install the Kumo SDK
- Build a graph from your data (three ways to do this)
- Run prediction queries using KumoRFM
Setup
Follow Steps 1–5 below to set up your notebook. These steps are the same regardless of which data source you use later.Step 1. Open Snowflake and go to Workspaces
Log in to your Snowflake account. In the left sidebar, click Projects, then click Workspaces.

Step 2. Create a new Notebook
In the left panel, click + Add new. A dropdown menu will appear. Click Notebook.
RFM_DEMO.ipynb).

Step 3. Connect your Notebook
Before you can run any code, you need to connect the notebook to a compute resource. Click the Connect button at the top of the notebook. A dialog called Connect your notebook will appear. Fill in the following settings:| Setting | What to enter |
|---|---|
| Service name | A name for the notebook service (e.g., KUMO_SNOWSERVICES_SERVICE_3) |
| External access integrations | Select an external access integration that has internet access (e.g., one that allows connections to PyPI). This is needed to install packages. Contact your Snowflake admin if you do not have one set up. |
| Compute type | Select CPU |
| Python version | Select Python 3.12 (or the latest available) |
| Runtime version | Select v2.3 (or the latest available) |
| Compute pool | Select SYSTEM_COMPUTE_POOL_CPU (CPU_X64_XS) or another CPU pool available to you |
| Idle timeout | Choose how long the notebook stays running when idle (e.g., 24 hours) |

Step 4. Install the Kumo SDK
In the first cell of your notebook, install thekumoai package by running:

Step 5. Import and initialize
In the next cell, import the required modules:

Build Your Graph and Make Predictions
A graph is a description of your data. It defines:- Your tables and their columns
- The primary and foreign key relationships between tables
- Semantic definitions on fields, such as whether a column is categorical
- Option A -From pandas DataFrames (quick testing with small datasets; the data must fit in notebook memory)
- Option B -From a Snowflake Semantic View (recommended for production; scales to any data size and captures rich semantic definitions)
- Option C -From Snowflake tables with manual table selection (no semantic view required; scales to any data size)
Option A loads your tables into pandas DataFrames inside the notebook, so the notebook’s compute pool needs enough memory to hold the data. For large datasets, use Option B or Option C instead, which read data directly from Snowflake without loading it into memory.
rfm.KumoRFM(graph) and run predictions with model.predict(query).
Option A: From pandas DataFrames (LocalGraph)
This is the easiest way to get started. You load data into pandas DataFrames (from S3, local files, or anywhere else) and let KumoRFM build a graph from them. Load the data and create tables:



- ENTITY -The user you predicted for
- ANCHOR_TIMESTAMP -The point in time the prediction is made from
- TARGET_PRED -The predicted class (
TRUE= will churn,FALSE= will not churn) - FALSE_PROB / TRUE_PROB -The probability of each outcome
Option B: From a Snowflake Semantic View
If your organization has a Snowflake Semantic View set up, you can build a graph directly from it. The semantic view already contains table definitions and relationships, so KumoRFM reads everything automatically. Set the database (if needed). Add a SQL cell and run:


Option C: From Snowflake tables directly
For production use, you will typically point KumoRFM at your Snowflake tables directly. You create aSnowTable for each table, then combine them into a Graph.
Build the graph from Snowflake tables:
database, schema, and table name values with your own. KumoRFM will detect primary keys, time columns, and foreign key relationships automatically.


Understanding the Prediction Output
Regardless of which option you used above, the prediction result is always a pandas DataFrame. The columns depend on the type of prediction:| Column | Description |
|---|---|
ENTITY | The entity you predicted for (e.g., a user ID, item ID, or opportunity ID) |
ANCHOR_TIMESTAMP | The point in time the prediction is made from. By default, this is the latest timestamp in your data. |
TARGET_PRED | The predicted value or class |
FALSE_PROB / TRUE_PROB | For binary classification tasks only -the probability of each outcome |
What’s Next
- Make Predictions -Learn PQL syntax in detail
- Prediction Types -All supported prediction types (classification, regression, forecasting, and more)
- Filters and Operators -Filter and refine your queries
evaluation-Evaluate prediction qualityconfiguration-Run modes, explainability, batch predictions- Snowflake Connector -More details on Snowflake table configuration