start_service()#

relationalai.app
start_service(<compute_pool_name>, <warehouse_name>)

Starts the RelationalAI (RAI) service on Snowpark Container Services using the specified compute pool and warehouse. The RAI service is the primary component of the RAI Native App and is responsible for managing RAI schemas and running RAI queries. Requires the app_admin application role.

Parameters#

NameTypeDescription
<compute_pool_name>STRINGThe name of the compute pool to use for the RAI service.
<warehouse_name>STRINGThe name of the warehouse to use for the RAI service.

Example#

Use start_service() to start the RAI service on Snowpark Container services. The service requires a dedicated compute pool and warehouse with USAGE and MONITOR privileges on each. See RelationalAI Service Management for more information.

For example, to start the service using a compute pool named rai_service_pool and a warehouse named rai_warehouse:

-- Create and configure a compute pool, if needed.
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;

-- Create and configure a warehouse, if needed.
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;

CALL relationalai.app.start_service('rai_service_pool', 'rai_warehouse');

See Also#