RelationalAI Service Management#

The RelationalAI (RAI) Service is the core component of the RAI Native App for Snowflake. It provides the ability to manage RAI schemas and run RAI queries written using the relationalai Python package

Required Resources#

The RAI service requires a dedicated compute pool and warehouse to run in Snowpark Container Services. These resources are typically created during the installation and setup process and are billed at their respective Snowflake rates without any surcharges from RAI. See Cost Management for more information on how charges are accrued.

RAI Service Compute Pool#

The RAI service requires USAGE and MONITOR privileges on a dedicated compute pool in order to run on Snowpark Container Services. Use the CREATE COMPUTE POOL command to create a compute pool for the RAI service and grant the necessary privileges to the RAI Native App:

CREATE COMPUTE POOL IF NOT EXISTS rai_service_pool
    FOR APPLICATION relationalai
    MIN_NODES = 1
    MAX_NODES = 1
    AUTO_RESUME = TRUE
    AUTO_SUSPEND_SECS = 300
    INSTANCE_FAMILY = CPU_X64_S;
GRANT USAGE, MONITOR ON COMPUTE POOL rai_service_pool TO APPLICATION relationalai;

See the Snowflake documentation for information on working with compute pools.

RAI Service Warehouse#

The RAI service requires USAGE and MONITOR privileges on a Snowflake warehouse for running service operations. Use the CREATE WAREHOUSE command to create a warehouse for the RAI service:

CREATE WAREHOUSE IF NOT EXISTS rai_warehouse WITH
    MAX_CONCURRENCY_LEVEL = 8
    WAREHOUSE_SIZE = 'X-SMALL'
    AUTO_SUSPEND = 180
    AUTO_RESUME = TRUE
    INITIALLY_SUSPENDED = TRUE;
GRANT USAGE ON WAREHOUSE rai_warehouse TO APPLICATION relationalai;

See the Snowflake documentation for information on working with warehouses.

Managing the RAI Service#

You can start, stop, suspend, resume, and drop the RAI service using the SQL procedures provided by the RAI Native App. All of these procedures require the app_admin application role.

Start the Service#

Use the start_service() procedure to start the RAI service:

CALL relationalai.app.start_service('<compute_pool_name>','<warehouse_name>');

Check Service Status#

To check the status of the RAI service, use the service_status() procedure:

CALL relationalai.app.service_status();

Suspend the Service#

Use the suspend_service() procedure to suspend the RAI service without dropping it:

CALL relationalai.app.suspend_service();

When the service is suspended, all running queries are canceled and the CDC engine is paused. Use suspend_service() to temporarily stop the service without losing any data for debugging purposes or to reduce costs. You can resume the service at any time to restore full functionality using the resume_service() procedure.

Certain background tasks, such as automated application updates, continue to run while the service is suspended and may incur charges. To stop the service, remove all resources, and stop incurring charges, use the drop_service() procedure.

See Cost Management for more information on managing costs.

Resume the Service#

Use the resume_service() procedure to resume the RAI service after it has been suspended:

CALL relationalai.app.resume_service();

Drop the Service#

To drop the RAI service, use the drop_service() procedure:

CALL relationalai.app.drop_service();

The service’s compute pool and warehouse are not deleted when the service is dropped. See DROP WAREHOUSE and DROP COMPUTE POOL in the Snowflake documentation for details on deleting these resources.

Dropping the service does not delete engines or their associated compute pools. To delete an engine, use the delete_engine() procedure.

Viewing Application Telemetry#

When you install the RAI Native App, you are prompted to share continuous telemetry data with RelationalAI. This data is written to your account’s active event table and contains operational information such as internal system logs, engine sizes, and usage data. Customer data and personally identifiable information are not included in continuous telemetry data.

See the Snowflake documentation for details on viewing and working with event tables.