plugins/rai/skills/rai-setup/SKILL.md
Setup and configuration for RelationalAI — first-time install walkthrough and all raiconfig.yaml tuning. Use when installing RAI, connecting to Snowflake, or editing raiconfig.yaml. Not for writing PyRel model code (see rai-pyrel-coding) or solver usage and diagnostics (see rai-prescriptive-solver-management).
npx skillsauth add RelationalAI/rai-agent-skills rai-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Covers the relationalai Python package (aka PyRel), which enables PyRel programs and ships the rai CLI.
What: End-to-end RelationalAI setup and configuration — installing the Python package, connecting to Snowflake, validating the environment, running a starter program, and tuning all configuration surfaces (auth, model, reasoners, engines, execution).
When to use:
relationalai, connect to Snowflake, run a starter programraiconfig.yamlWhen NOT to use:
rai-pyrel-codingrai-ontology-designrai-prescriptive-solver-managementrai-discoveryOverview: For a returning user tweaking config, start from Quick Reference below and the Reference files trigger table — load only the reference matching the task. For a first-time user, drop into First-Time Setup Workflow and walk them through install → connect → validate → starter → next steps. Always finish a connection change by running rai connect — never hand the user a config and assume it works.
Requires Python 3.10+ and relationalai>=1.2.0.
The RelationalAI Native App for Snowflake must be installed in your account by an administrator — request access here; see the Native App docs.
The rai_developer role is the standard role for running PyRel programs. Custom Snowflake roles also work if granted the rai_user application role — see User Access.
Predictive (GNN) workflows need additional schema setup beyond the base install — a customer-owned database + schema with USAGE and CREATE EXPERIMENT/CREATE MODEL granted to APPLICATION RELATIONALAI. Without it the very first gnn.fit() fails. See rai-predictive-modeling § Prerequisites for the DDL. The predictive submodule (relationalai.semantics.reasoners.predictive) also requires a relationalai version that ships it — confirm the minimum with the RelationalAI team before pinning.
Support / docs: [email protected] · [email protected] · docs.relational.ai
rai init # scaffold a new raiconfig.yaml
rai connect # validate the connection (run after any connection change)
# Minimal raiconfig.yaml
default_connection: sf
connections:
sf:
type: snowflake
authenticator: username_password
account: my_account
warehouse: my_warehouse
user: my_user
password: {{ env_var('SNOWFLAKE_PASSWORD') }}
# Programmatic config (no YAML needed)
import os
from relationalai.config import create_config
from relationalai.semantics import Model
config = create_config(
default_connection="sf",
connections={
"sf": {
"type": "snowflake",
"authenticator": "username_password",
"account": os.environ["SNOWFLAKE_ACCOUNT"],
"warehouse": os.environ["SNOWFLAKE_WAREHOUSE"],
"user": os.environ["SNOWFLAKE_USER"],
"password": os.environ["SNOWFLAKE_PASSWORD"],
}
},
)
model = Model("my_model", config=config)
Verify: run rai connect before writing model code, and after any connection change.
Before proposing fields in a user's raiconfig.yaml or a create_config(...) call, verify field names against raiconfig-yaml.md or programmatic-config.md. Do not invent kwargs.
Users are expected to be Snowflake users with existing credentials. Walk the user through these steps one-by-one, explaining each and prompting for the inputs you need to run it on their behalf.
pip install relationalai>=1.2.0
# or
uv add relationalai>=1.2.0
Check whether the user has an existing Snowflake connection (~/.snowflake/config.toml) or DBT connection (~/.dbt/profiles.yml).
rai or a PyRel program directly.rai init to create a raiconfig.yaml, then fill in account, warehouse, user, authenticator. See raiconfig-yaml.md for the field reference and authentication.md for authenticator choice.Run rai connect to validate the configuration.
username_password_mfa or externalbrowser.Offer a small sample program using inline data. Ask the user for a domain or use case and tailor the sample to it; if they don't have one, use a minimal structural default — one concept, a handful of instances, one derivation rule, one query — so the sample exercises the install without committing to a vertical. For PyRel syntax load rai-pyrel-coding. Ensure the sample runs and the user sees output. Offer to explain the components.
Load the reference when the trigger fires — don't read them all upfront.
| Load when… | Reference |
|---|---|
| Creating or editing a raiconfig.yaml (need field names, defaults, profile overlays, env-var syntax, or fallback-source order) | raiconfig-yaml.md |
| Choosing an authenticator, user reports MFA/browser-auth failure, or running inside SPCS / Snowflake Notebooks | authentication.md |
| Building config in Python instead of YAML, or fetching a session / clearing a session cache | programmatic-config.md |
| Configuring reasoners — backend, engine size, Gurobi, polling — or reasoner name/size doesn't take effect as expected | reasoners.md |
| Turning on metrics/logging, tuning retries, toggling compiler strictness, or changing data-loading defaults | execution.md |
| Provisioning, listing, resuming, or deleting engines via CLI/Python API, or evaluating warm reasoners | engine-management.md |
| Mistake | Cause | Fix |
|---|---|---|
| Errors about RelationalAI Native App not existing | NA not installed, or current role lacks access | Verify the Native App is installed and the current role has rai_developer or a custom role granted the rai_user application role |
| raiconfig.yaml not found | File not in CWD or any parent directory | Place raiconfig.yaml in project root; create_config() walks upward from CWD |
| First invalid config raises with no fallback | PyRel validates the first source found; if invalid it stops | Fix the file — does not fall back to lower-priority sources after a parse error |
| Both raiconfig.toml and .yaml present | TOML may take precedence in some code paths | Remove .toml and use .yaml as canonical |
| direct_access backend with no direct_access_base_url | URL is required when backend: direct_access | Set reasoners.direct_access_base_url or switch to backend: sql |
| execution.logging: true produces no output | Python logging must be configured separately | Add logging.getLogger("relationalai.client.execution").setLevel(logging.INFO) |
| Auth fails with externalbrowser in CI | Browser auth requires an interactive session | Use jwt or username_password for non-interactive environments |
| Engine not provisioned | Reasoner config references a size unavailable on account | Check reasoners.*.size matches available sizes for your platform |
| Unicode errors on Windows (UnicodeEncodeError) | Windows console defaults to a non-UTF-8 encoding | Set PYTHONIOENCODING=utf-8. PowerShell: $env:PYTHONIOENCODING = "utf-8"; cmd: set PYTHONIOENCODING=utf-8 |
| rai CLI fails on PowerShell | Execution policy blocks scripts | User runs Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned |
rai-pyrel-coding — PyRel syntax and data loadingrai-ontology-design — domain modelingrai-discovery — surface answerable questions and route to the right reasonerrai-prescriptive-solver-management — solver lifecycle and diagnostics (includes Gurobi usage)rai-health — diagnose engine performance issuesdata-ai
Configure and train graph neural network (GNN) models, generate predictions, evaluate results, and manage trained models. Use when ready to train, generate predictions, evaluate, or manage models; for concepts, data loading, edges, and feature configuration, see `rai-predictive-modeling`.
development
Build graph neural network (GNN) models — concepts, Snowflake data loading, task relationships, graph edges, and PropertyTransformer features. Use for node classification, regression, and link prediction tasks; for training, predictions, and evaluation, see `rai-predictive-training`.
testing
Converts natural language business rules into PyRel derived properties — validation, classification, derivation, alerting, and reconciliation. Use whenever a task assigns each entity a new tier, segment, score, or flag, or derives a new property; author it here as a derived property, then query it with rai-querying.
data-ai
PyRel v1 query construction against `relationalai.semantics.Model` — selects, filters, joins, aggregates, grouping, export. Load this BEFORE writing any PyRel query, even your first one — your prior knowledge of the syntax is likely stale. Use whenever the user asks to query, count, list, rank, aggregate, join, or export data from a RAI model, even if they don't say "PyRel". Does not cover deriving new classifications, tiers, flags, segments, or properties — those must be authored with the `rai-rules-authoring` skill first.