Skip to main content
Get your API keyGenerate an API key at kumorfm.ai/api-keys to get started. New accounts include 1,000 queries per day at no cost.
In this guide, we walk you through an end-to-end example using a multi-table E-Commerce dataset. You’ll learn how to load data, auto-infer a relational graph, and run instant predictions: demand forecasting, churn prediction, item recommendations, and missing value imputation, all without training a model.

Step 1: Install the SDK

Install the python SDK
pip install kumoai

Step 2: Get an API key

You need an API key to make calls to KumoRFM. You can generate an API key for free at https://kumorfm.ai. Currently the daily query limit is 1000/day.

Step 3: Initialize a client

Use the generated API key to intialize a kumo client:
import kumoai.experimental.rfm as rfm, os

os.environ["KUMO_API_KEY"] = "ENTER_YOUR_API_KEY_HERE"

rfm.init()

Step 4: Import your data

We will use an E-Commerce dataset for this example:
import pandas as pd

dataset_url = "s3://kumo-sdk-public/rfm-datasets/online-shopping"

users_df = pd.read_parquet(f"{dataset_url}/users.parquet")
items_df = pd.read_parquet(f"{dataset_url}/items.parquet")
orders_df = pd.read_parquet(f"{dataset_url}/orders.parquet")

Step 5: Create a graph

Auto infer links between tables to form a graph
graph = rfm.LocalGraph.from_data({
    "users": users_df,
    "items": items_df,
    "orders": orders_df,
})

# Inspect the graph - requires graphviz to be installed
graph.visualize()

Step 6: Make a prediction

Write a predictive query to generate instant predictions:
model = rfm.KumoRFM(graph)

# Forecast 30-day product demand
query1 = "PREDICT SUM(orders.price, 0, 30, days) FOR items.item_id=1"
result1 = model.predict(query1)
display(result1)

# Predict customer churn
query2 = "PREDICT COUNT(orders.*, 0, 90, days)=0 FOR users.user_id IN (42, 123)"
result2 = model.predict(query2)
display(result2)

# Item recommendation
query3 = "PREDICT LIST_DISTINCT(orders.item_id, 0, 30, days) RANK TOP 10 FOR users.user_id=123"
result3 = model.predict(query3)
display(result3)

# Missing value imputation
query4 = "PREDICT users.age FOR users.user_id=8"
result4 = model.predict(query4)
display(result4)

Notebooks

Explore practical examples and use cases through our interactive notebooks.

Quickstart

Use KumoRFM for instant predictions using your own dataset with no model training required.KumoRFM · pandas

E-commerce Agent

Build an e-commerce agent that identifies churn risk, predicts probabilities, and generates re-engagement emails.KumoRFM · CrewAI · OpenAI · MCP

Sales Agent

Build a sales agent for lead scoring that identifies high-value prospects and creates prioritized outreach lists.KumoRFM · OpenAI Agents SDK · MCP

Insurance Agent

Build an insurance agent that predicts policy expiration risks, recommends bundling, and generates retention emails.KumoRFM · LangGraph · Anthropic · MCP

Handbook

Comprehensive guide showing graph schema definition, predictive queries, and model evaluation using Formula 1 data.KumoRFM · RelBench · scikit-learn

Hands-on Tutorial

Interactive tutorial demonstrating predictive analytics on multi-table datasets using Super Mario Maker game data.KumoRFM · pandas

Predictive Query Language

Learn PQL to frame entire ML tasks in SQL-like statements using the Steam gaming dataset.KumoRFM · PQL

RelBench Evaluation

Step-by-step guide for evaluating KumoRFM performance on custom datasets using rel-bench.KumoRFM · RelBench · scikit-learn

SALT Dataset

Advanced evaluation on complex enterprise ERP dataset for multi-class classification.KumoRFM · Hugging Face · datasets

Single Table Classification

Demonstrates binary classification on single tabular data using the scikit-learn breast cancer dataset.KumoRFM · scikit-learn · NumPy