Skip to content

Using the RelationalAI Predictive Reasoner Locally

To use the RelationalAI Predictive Reasoner, you’ll need access to the RelationalAI Native App. You can request access via the Snowflake Marketplace. When submitting your request, be sure to include a note indicating that you’re interested in the app’s predictive reasoning capabilities using graph neural networks (GNNs).

Once your request is approved you will receive email notification by RAI. Follow the instructions here to install the RAI Native App. Note that you will need to be a user with either ORGADMIN or ACCOUNTADMIN privileges to do the installation.

If you have already installed the RelationalAI Native App reach out to us to request enabling the predictive reasoning feature flag.

To train models and make predictions with the RelationalAI Predictive Reasoner, you’ll need access to certain RelationalAI services via the Predictive Reasoner Python SDK. To this end, you will need the relationalai_gnns package.

To install the SDK first create and activate a conda environment:

Terminal window
conda create -n rai_gnn_env python==3.11
conda activate rai_gnn_env

Then install it:

Terminal window
pip install relationalai-gnns

If you want to visualize the database schema you will need to install Graphviz. Make sure Graphviz is installed on your system (for the dot binary to be available):

  • macOS: brew install graphviz
  • Ubuntu: sudo apt install graphviz
  • Windows: Download Graphviz and add it to your PATH

To verify the installation on a Jupyter Notebook you can run the command:

!which dot

which should point to the location that Graphviz is installed, or you can use the following sanity check:

from graphviz import Digraph
dot = Digraph()
dot.node('A')
dot.node('B')
dot.edge('A', 'B')
dot.render('test-output.gv', view=False)

As a workaround if dot is in a known location you can try setting the path explicitly at the start of your imports:

import os
os.environ["PATH"] += os.pathsep + "/opt/homebrew/bin"