In this quickstart, we'll use RelationalAI — a Native App available in the Snowflake Marketplace — to run community detection algorithms. The sample data represent food-truck orders, and we'll use them to identify groups of customers who probably know each other. This allows us to build a social graph and interact with groups of related customers.
RelationalAI is a cloud-native platform that enables organizations to streamline and enhance decisions with intelligence. RelationalAI extends Snowflake with native support for an expanding set of AI workloads (e.g., graph analytics, rule-based reasoning, and optimization), all within your Snowflake account, offering the same ease of use, scalability, security, and governance.
Users can build a knowledge graph using Python and materialize it on top of their Snowflake data, which are shared with the RelationalAI app through Snowflake Streams. Insights can be written to Snowflake tables and shared across the organization.
RAI_DEMO.TASTYBYTES.ORDER
that contains the data used in this quickstart.In addition to your Snowflake account setup, follow the steps below to set up a local installation of Python with Jupyter Lab and the RelationalAI Python library.
python3 --version
from your terminal. python3.11 --version
from your terminal.python3.11 -m venv .venv # or python3 -m venv .venv, if you don't have a python3.11 executable
source .venv/bin/activate # Activate on Linux and macOS.
# .venv\Scripts\activate # Activate on Windows.
python -m pip install jupyterlab relationalai
After installing the relationalai
package, you will need to set up a RAI configuration with the Snowflake credenrtials you want to use (similar to the configuration for Snowflake CLI).
Run rai init
from your terminal and follow the prompts to enter your credentials and other configuration data:
Snowflake
as your host platform.~/.snowflake/connections.toml
if you have one, or enter your username, password, and Account ID otherwise.rai_user
that you created earlier.[CREATE A NEW ENGINE]
to create a new engine. Enter any name you want for the engine, for example rai_engine
. (Usually you would not want to select the same engine you created above for CDC.)HighMem|S
as the engine size.rai_compute_pool
that you created above.Enter
to accept the default profile name of default
.jupyter lab
and visit the URL (something like http://localhost:8888/lab?token=XXXX
) printed in the console output in your browser.community-detection.ipynb
file in Jupyter lab. You should see the top of the notebook:RAI_DEMO.TASTYBYTES.ORDERS
, scroll down to the Appendix and run the cells in that section to insert the data for this demo into your Snowflake account.Congratulations on completing the our Community Detection using RelationalAI guide! In this Quickstart you learned