Manage the RAI Native App's Compute Resources
The RelationalAI (RAI) Native App requires compute resources to evaluate queries from PyRel semantic models. This section provides an overview of these compute resources and how they are managed. For information on costs associated with these resources, see Cost Management.
App Warehouse
Section titled “App Warehouse”The RAI Native App utilizes an X-SMALL Snowflake warehouse for Snowflake interoperability.
This warehouse is named RELATIONAL_AI_ERP_WAREHOUSE and is fully managed by the native app.
It is automatically provisioned when you activate the app and suspended when you deactivate the app.
See the Snowflake documentation for information on warehouses.
Compute Pools
Section titled “Compute Pools”Snowflake compute pools are collections of compute resources that are managed as a shared pool. The RAI Native App uses compute pools to host reasoners that process queries from PyRel semantic models.
Managed Pools
Section titled “Managed Pools”When you install the RAI Native App, the following compute pools are automatically provisioned:
| Name | Snowflake Instance Family | Supported Cloud Platforms | Description |
|---|---|---|---|
RELATIONAL_AI_ERP_COMPUTE_POOL | CPU_X64_XS | AWS, Azure | Used for internal app operations. |
RELATIONAL_AI_COMPILE_CACHE_SPCS | HIGHMEM_X64_M | AWS, Azure | Used for internal app operations. |
RELATIONAL_AI_HIGHMEM_X64_S | HIGHMEM_X64_S | AWS, Azure | Runs reasoners that execute queries from semantic models. |
RELATIONAL_AI_HIGHMEM_X64_M | HIGHMEM_X64_M | AWS, Azure | Runs reasoners that execute queries from semantic models. |
RELATIONAL_AI_HIGHMEM_X64_L | HIGHMEM_X64_L | AWS only | Runs reasoners that execute queries from semantic models. |
RELATIONAL_AI_HIGHMEM_X64_SL | HIGHMEM_X64_SL | Azure only | Runs reasoners that execute queries from semantic models. |
RELATIONAL_AI_CPU_X64_S | CPU_X64_S | AWS, Azure | Reserved for future use. |
RELATIONAL_AI_CPU_X64_M | CPU_X64_M | AWS, Azure | Reserved for future use. |
These compute pools are fully managed by the RAI Native App. They are automatically suspended when you deactivate the app and resumed when you activate the app.
You are only charged for resources consumed by the reasoners running on a compute pool, so unused compute pools do not incur costs. See Cost Management for more information.
Nodes and Node Limits
Section titled “Nodes and Node Limits”Each compute pool is composed of a configurable number of nodes. A node represents the capacity required to run exactly one RAI reasoner of the pool’s instance family. When a reasoner starts, it consumes one node from the corresponding compute pool until it suspends or is deleted.
Two limits control node capacity per pool:
-
MIN_NODESsets the minimum number of nodes that are always ready for reasoners. This is controlled in RAI by themin_nodesargument to theapi.alter_reasoner_pool_node_limits()procedure. Snowflake reserves and bills for this many nodes, even if no reasoners are running. Setting a higher value is a good way to keep nodes hot for faster reasoner provisioning, but you will always pay for the reserved nodes. For RAI managed compute pools, the default is0, meaning no capacity is reserved. -
MAX_NODESsets the maximum number of reasoners that can run at the same time. This is controlled in RAI by themax_nodesargument to theapi.alter_reasoner_pool_node_limits()procedure. If you try to start a reasoner when this limit is reached, the request will fail and the reasoner will not start until there is available capacity. For RAI managed compute pools, the default is10, meaning up to ten reasoners of a given size can run concurrently.
Reasoners
Section titled “Reasoners”Reasoners are virtual machines that process queries and other RelationalAI jobs from PyRel semantic models. They are hosted in the compute pools managed by the RAI Native App. Like Snowflake virtual warehouses, reasoners can be independently created for workload isolation or scaling purposes.
Logic Reasoners
Section titled “Logic Reasoners”Every semantic model requires a logic reasoner to process definitions and queries. When a user queries a model using the Python API, the RAI Native App resumes the user’s configured logic reasoner if it is suspended, or automatically creates a new reasoner for the user if one does not exist.
By default, each user has a dedicated reasoner. This ensures jobs are isolated per user by default, though a user may run multiple concurrent jobs on their reasoner.
If you need fine-grained control over resource allocation, you can create and manage reasoners manually using SQL, Python, or the RAI CLI. Semantic models can then be configured to use specific reasoners using configuration keys:
| Configuration Key | Description |
|---|---|
Name | Name of the reasoner to use. Defaults to the user’s Snowflake username with dots replaced by underscores—for example, w.riker@relational.ai becomes w_riker. |
Size | Size of the reasoner. Defaults to HIGHMEM_X64_S. See Reasoner Sizes for details. |
Solver Reasoners Preview
Section titled “Solver Reasoners ”Solver reasoners process jobs sent using the relationalai Python package’s SolverModel API.
When a user calls SolverModel.solve(), their solver reasoner resumes if suspended, or a new one is created using the configured solver reasoner name.
CDC Engine
Section titled “CDC Engine”If you have enabled the CDC Service, a reasoner named CDC_MANAGED_ENGINE is automatically provisioned whenever changes to a data stream are detected.
This reasoner processes changes to Snowflake tables and views shared with the RAI Native App for use in semantic models.
It is suspended automatically after 30 minutes of inactivity or when you disable the CDC Service.
By default, the CDC_MANAGED_ENGINE is provisioned in the app’s HIGHMEM_X64_S compute pool.
However, you may alter the CDC reasoner size if needed.
Reasoner Sizes
Section titled “Reasoner Sizes”A reasoner’s size refers to the instance family of the compute pool it is hosted on. Different instance families provide varying levels of CPU, memory, and storage resources. The RAI Native App currently supports the following reasoner sizes:
| Reasoner Size | Supported Reasoner Types | Supported Cloud Platforms | Description |
|---|---|---|---|
HIGHMEM_X64_S | CDC, Logic, Solver | AWS, Azure | Optimized for small workloads |
HIGHMEM_X64_M | CDC, Logic, Solver | AWS, Azure | Optimized for medium workloads |
HIGHMEM_X64_L | CDC, Logic | AWS only | Optimized for large workloads |
HIGHMEM_X64_SL | CDC, Logic | Azure only | Optimized for large workloads |
Reasoner Suspension
Section titled “Reasoner Suspension”By default, new reasoners automatically suspend after one hour of inactivity. You may also manually suspend a reasoner to save costs when it is not in use. While suspended, a reasoner does not consume compute resources. Jobs sent to a suspended reasoner will fail until the reasoner is resumed.
To change the inactivity window for a reasoner:
-
Set the
auto_suspend_minsoption when creating a new reasoner. -
Use the
api.alter_reasoner_auto_suspend_mins()procedure to update the auto-suspend time for an existing reasoner. See Change Reasoner Auto-Suspend Time for details. -
Set the
auto_suspend_minsconfiguration key in a user’sraiconfig.yamlfile or aConfiginstance. If unset, the default value of60minutes applies. Changes to this key take effect the next time the user creates a model.
Suspended reasoners automatically resume via the RAI Python API when users execute a query. You can also manually resume a suspended reasoner.
Jobs and Concurrency
Section titled “Jobs and Concurrency”A RelationalAI job is a unit of work that a reasoner processes. Jobs include automated tasks like processing changes to data streams as well as user-initiated tasks like evaluating queries from semantic models.
Query Timeouts
Section titled “Query Timeouts”By default, queries sent by the RAI Python API have a timeout of 24 hours in order to prevent long-running queries from consuming resources indefinitely and incurring unexpected costs. Jobs from automated tasks, like processing changes to data streams, are not subject to this timeout. Only user-initiated queries are affected.
Python API users can change this timeout for their queries by setting the query_timeout_mins configuration key in their raiconfig.yaml file or a Config instance.
See Set the query timeout for details.
Concurrent Jobs
Section titled “Concurrent Jobs”Each reasoner supports up to 8 concurrent jobs and has a queue capacity of 128 jobs with first-in/first-out priority. However, reasoners may process resource-intensive jobs, like large-scale graph algorithms, sequentially.
By default, each user has a dedicated reasoner created for them automatically the first time they create a model. This ensures jobs are isolated per user by default, though a user can run multiple concurrent jobs on their reasoner.
Concurrent jobs on the same reasoner may impact each other’s performance. To avoid coordination issues, especially when resource-intensive jobs are involved, consider creating a dedicated reasoner for each workload.
You can determine if a reasoner is overloaded by monitoring it for a large number of jobs in the QUEUED or CREATED state.
See Monitor Reasoner Jobs for details.
Warm Reasoners Preview
Section titled “Warm Reasoners ”Warm reasoners are pre-provisioned reasoners that are kept running and ready to accept jobs immediately. If a user creates a new reasoner or resumes a suspended reasoner, and a warm reasoner is available for the requested reasoner size, the warm reasoner is assigned to the user instead of provisioning a new reasoner from scratch. This reduces latency for reasoner startup.
When enabled, the warm reasoner is created automatically and kept running indefinitely.
If a warm reasoner is assigned to a user, a new warm reasoner is created automatically to replace it to keep the total number of available warm reasoners constant. Note, however, that the next user requesting a reasoner of that size may experience some startup latency if the replacement warm reasoner is still provisioning.
Limitations of warm reasoners:
- Only logic reasoners are supported. Solver and CDC reasoners cannot be configured as warm reasoners.
For management details, see:
Expand the sections below for answers to common questions about warm reasoners:
What’s the difference between a warm reasoner and a non-suspending reasoner?
You can accomplish similar behavior to a warm reasoner by configuring a reasoner to never auto-suspend. However, the two concepts are only loosely related.
A non-suspending reasoner keeps the same reasoner instance running indefinitely, unless it is manually suspended or deleted. In contrast, a warm reasoner only impacts reasoner startup. If the user creates or resumes a reasoner, they receive the warm reasoner instance if available. The warm reasoner is then configured according to the requested settings, including auto-suspend behavior.
Will I be charged for warm reasoners?
Warm reasoners consume compute resources while they are running, so users on consumption-based plans will be charged for the time they are active.
Users on fixed-price plans are still responsible for the Snowflake compute costs associated with warm reasoners, but enabling them will not increase the fixed price for the RAI Native App.
Can I have more than one warm reasoner?
Yes.
Use app.set_warm_reasoners() to configure how many warm reasoners to keep running for each size.
Reasoner Management
Section titled “Reasoner Management”You can manage reasoners using SQL, Python, or the RAI CLI.
Create a Reasoner
Section titled “Create a Reasoner”Requires the eng_admin application role.
To create a reasoner, pass strings with the desired reasoner name and size to the api.create_reasoner() procedure:
-- Create a HIGHMEM_X64_S 'logic' reasoner named 'my_reasoner'.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.create_reasoner( 'logic', -- Reasoner type. 'my_reasoner', -- Reasoner name. 'HIGHMEM_X64_S', -- Reasoner size {'auto_suspend_mins': 60} -- Auto-suspend after 60 minutes of inactivity.);+--------------+----------------------+| NAME | MESSAGE ||--------------+----------------------|| my_reasoner | reasoner created |+--------------+----------------------+-- Create a HIGHMEM_X64_S 'prescriptive' reasoner named 'my_reasoner2'.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.create_reasoner( 'prescriptive', -- Reasoner type. 'my_reasoner2', -- Reasoner name. 'HIGHMEM_X64_S', -- Reasoner size {} -- Use default configuration settings.);+--------------+----------------------+| NAME | MESSAGE ||--------------+----------------------|| my_reasoner2 | reasoner created |+--------------+----------------------+-- Create a HIGHMEM_X64_S 'predictive' reasoner named 'my_reasoner3'.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.create_reasoner( 'predictive', -- Reasoner type. 'my_reasoner3', -- Reasoner name. 'HIGHMEM_X64_S', -- Reasoner size {} -- Use default configuration settings.);+--------------+----------------------+| NAME | MESSAGE ||--------------+----------------------|| my_reasoner3 | reasoner created |+--------------+----------------------+To create a reasoner using Python, use connect_sync() to create a client and then call client.reasoners.create_ready().
from relationalai.client import connect_sync
with connect_sync() as client: # Create a HIGHMEM_X64_S Logic reasoner configured to auto-suspend after 60 minutes of inactivity. client.reasoners.create_ready( "Logic", "my_reasoner", reasoner_size="HIGHMEM_X64_S", auto_suspend_mins=60, )To create a reasoner using the RAI CLI, run the reasoners:create command with the desired reasoner name and size provided as arguments to the --name and --size options:
# Create a HIGHMEM_X64_S reasoner.rai reasoners:create --type logic --name my_reasoner --size HIGHMEM_X64_S --auto-suspend-mins 60 --wait
# Create a HIGHMEM_X64_M reasoner.rai reasoners:create --type logic --name my_reasoner --size HIGHMEM_X64_M --auto-suspend-mins 60 --waitReasoner names must be between 3 and 50 characters long and can contain only a-z, A-Z, 0-9, and _ characters.
Note that it may take several minutes for the reasoner to be provisioned and ready for use.
Delete a Reasoner
Section titled “Delete a Reasoner”Requires the eng_admin application role.
To delete a reasoner, pass the reasoner name to the api.delete_reasoner() procedure:
-- Delete the 'logic' reasoner named 'my_reasoner'.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.delete_reasoner('logic', 'my_reasoner');+-------------+------------------------+| NAME | MESSAGE ||-------------+------------------------|| my_reasoner | deleted successfully |+-------------+------------------------+To delete a reasoner using Python, create a client with connect_sync() and call client.reasoners.delete():
from relationalai.client import connect_sync
with connect_sync() as client: client.reasoners.delete("Logic", "my_reasoner")To delete a reasoner using the RAI CLI, run the reasoners:delete command with the reasoner type and name provided as arguments to the --type and --name options:
rai reasoners:delete --type logic --name my_reasonerWhen a reasoner is deleted, all current and queued jobs are cancelled. Any new jobs submitted to the reasoner will fail.
View Available Reasoners
Section titled “View Available Reasoners”Requires the eng_user application role.
To list all reasoners, query the api.reasoners view:
SELECT * FROM relationalai.api.reasoners;+------------------------+--------+--------------+------+-------+-----------------------+--------------------------------+-------------------------------+-------------------------+-------------------+-------------------------+--------------------------------+--------------------------------------------------------------------+| NAME | TYPE | ID | SIZE | STATUS | CREATED_BY | CREATED_ON | UPDATED_ON | VERSION | AUTO_SUSPEND_MINS | SUSPENDS_AT | SETTINGS | RUNTIME ||------------------------+--------+--------------+------+-------+-----------------------+--------------------------------+-------------------------------+-------------------------+-------------------+-------------------------+--------------------------------+--------------------------------------------------------------------+| john_doe | logic | e4f5a6d7c8e9 | M | READY | john.doe@company.com | 2026-01-26 17:29:53.110 -0700 | 2026-01-26 17:29:54.319 -0700 | 2026-01-26-e829e39d | 60 | 2026-01-26 18:29:53.110 | {"await_storage_vacuum": true} | {"compute_pool":"RELATIONAL_AI_HIGHMEM_X64_S","is_warming":false} |+------------------------+--------+--------------+------+-------+-----------------------+--------------------------------+-------------------------------+-------------------------+-------------------+-------------------------+--------------------------------+--------------------------------------------------------------------+Refer to the reference docs for details about each column in the api.reasoners view.
To list all reasoners using Python, create a client with connect_sync() and call client.reasoners.list():
from relationalai.client import connect_sync
with connect_sync() as client: reasoners = client.reasoners.list() print(reasoners)To list all reasoners using the RAI CLI, run the reasoners:list command:
rai reasoners:listGet Reasoner Details
Section titled “Get Reasoner Details”Requires the eng_user application role.
To get details about a specific reasoner, pass the reasoner name to the api.get_reasoner() procedure:
-- Get details about the 'logic' reasoner named 'my_reasoner'.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.get_reasoner('logic', 'my_reasoner');+---------------------+-------+--------------+-------------------------+------+--------+------------+-------------------------------+-------------------------------+-------------------+-------------------------+---------------------------------+-------------------------------------------------------------------+| NAME | TYPE | ID | VERSION | SIZE | STATUS | CREATED_BY | CREATED_ON | UPDATED_ON | AUTO_SUSPEND_MINS | SUSPENDS_AT | SETTINGS | RUNTIME ||---------------------+-------+--------------+-------------------------+------+--------+------------+-------------------------------+-------------------------------+-------------------+-------------------------+---------------------------------+-------------------------------------------------------------------+| my_reasoner | logic | a9d7f3b2c8e4 | 2026.01.27-e829e39d | S | READY | SYSTEM | 2026.01.27 15:22:15.500 -0700 | 2026-01-27 15:22:16.731 -0700 | 0 | NULL | {"await_storage_vacuum": false} | {"compute_pool":"RELATIONAL_AI_HIGHMEM_X64_S","is_warming":false} |+---------------------+-------+--------------+-------------------------+------+--------+------------+-------------------------------+-------------------------------+-------------------+-------------------------+---------------------------------+-------------------------------------------------------------------+To get details about a specific reasoner using Python, create a client with connect_sync() and call client.reasoners.get():
from relationalai.client import connect_sync
with connect_sync() as client: reasoner = client.reasoners.get("Logic", "my_reasoner") print(reasoner)To get details about a specific reasoner using the RAI CLI, run the reasoners:get command with the reasoner type and name provided as arguments to the --type and --name options:
rai reasoners:get --type logic --name my_reasonerView Idle Reasoners
Section titled “View Idle Reasoners”Requires the eng_user application role.
Reasoners that have been automatically scheduled for suspension due to inactivity are considered idle.
You can view idle reasoners by filtering the api.reasoners view for rows where the STATUS column is READY and the SUSPENDS_AT column is not null:
SELECT * FROM relationalai.api.reasonersWHERE STATUS = 'READY' AND SUSPENDS_AT IS NOT NULL;Reasoners that have been automatically scheduled for suspension due to inactivity are considered idle.
To view idle reasoners using Python, create a client with connect_sync() and query the api.reasoners view using the client’s SQL executor:
from relationalai.client import connect_sync
with connect_sync() as client: sql = client.core.sql_executor assert sql is not None
idle_reasoners = sql.collect( """ SELECT * FROM relationalai.api.reasoners WHERE STATUS = 'READY' AND SUSPENDS_AT IS NOT NULL; """, operation="list_idle_reasoners", ) print(idle_reasoners)Suspend a Reasoner
Section titled “Suspend a Reasoner”Requires the eng_admin application role.
To suspend a reasoner, pass the reasoner name to the api.suspend_reasoner() procedure:
-- Suspend the 'logic' reasoner named 'my_reasoner'.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.suspend_reasoner('logic', 'my_reasoner');+---------------+--------+------------------------+| NAME | TYPE | MESSAGE |+---------------+--------+------------------------+| my_reasoner | logic | suspended successfully |+---------------+--------+------------------------+To suspend a reasoner, run the reasoners:suspend command with the reasoner type and name provided as arguments to the --type and --name options:
rai reasoners:suspend --type logic --name my_reasonerTo suspend a reasoner using Python, create a client with connect_sync() and call client.reasoners.suspend():
from relationalai.client import connect_sync
with connect_sync() as client: client.reasoners.suspend("Logic", "my_reasoner")Resume a Suspended Reasoner
Section titled “Resume a Suspended Reasoner”Requires the eng_admin application role.
To resume a suspended reasoner, pass the reasoner name to the api.resume_reasoner_async() procedure:
-- Resume the 'logic' reasoner named 'my_reasoner' if it is suspended.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.resume_reasoner_async('logic', 'my_reasoner');+-------------+--------+----------------------+| NAME | TYPE | MESSAGE ||-------------+--------+----------------------|| my_reasoner | logic | resumed successfully |+-------------+--------+----------------------+To resume a suspended reasoner, run the reasoners:resume command with the reasoner type and name provided as arguments to the --type and --name options:
rai reasoners:resume --type logic --name my_reasoner --waitTo resume a suspended reasoner using Python, create a client with connect_sync() and call client.reasoners.resume_ready():
from relationalai.client import connect_sync
with connect_sync() as client: client.reasoners.resume_ready("Logic", "my_reasoner")Change Reasoner Auto-Suspend Time
Section titled “Change Reasoner Auto-Suspend Time”Requires the eng_admin application role.
To change the auto-suspend time for a reasoner, pass the reasoner name and the desired auto-suspend time in minutes to the api.alter_reasoner_auto_suspend_mins() procedure:
-- Set the auto-suspend time for the 'logic' reasoner named 'my_reasoner' to 30 minutes.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.alter_reasoner_auto_suspend_mins('logic', 'my_reasoner', 30);+---------+| Success |+---------+To change the auto-suspend time for a reasoner using Python, create a client with connect_sync() and execute the api.alter_reasoner_auto_suspend_mins() procedure using the client’s SQL executor:
from relationalai.client import connect_sync
with connect_sync() as client: sql = client.core.sql_executor assert sql is not None
sql.collect( "CALL relationalai.api.alter_reasoner_auto_suspend_mins('logic', 'my_reasoner', 30)", operation="alter_reasoner_auto_suspend_mins", )Enable Warm Reasoners
Section titled “Enable Warm Reasoners”Requires the app_admin application role.
To enable a warm reasoner for a compute pool, pass the compute pool’s instance family to the app.enable_warm_reasoner() procedure as a string:
-- Enable a warm 'logic' reasoner for the HIGHMEM_X64_S compute pool.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.app.enable_warm_reasoner('logic', 'HIGHMEM_X64_S');+------------------------------------------------------------+| Successfully enabled a warm reasoner of size HIGHMEM_X64_S |+------------------------------------------------------------+Disable Warm Reasoners
Section titled “Disable Warm Reasoners”Requires the app_admin application role.
To disable the warm reasoner for a compute pool, pass the compute pool’s instance family to the app.disable_warm_reasoner() procedure as a string:
-- Disable the warm 'logic' reasoner for the HIGHMEM_X64_S compute pool.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.app.disable_warm_reasoner('logic', 'HIGHMEM_X64_S');+------------------------------------------------------------+| Successfully disabled warm reasoners of size HIGHMEM_X64_S |+------------------------------------------------------------+Resize a Reasoner
Section titled “Resize a Reasoner”Requires the eng_admin application role.
Reasoners cannot be resized on-the-fly. To resize a reasoner:
-
Delete the existing reasoner
Pass the reasoner type and name to the
api.delete_reasoner()procedure to delete the reasoner:-- Delete the 'logic' reasoner named 'my_reasoner'.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.delete_reasoner('logic', 'my_reasoner');Output +-------------+----------------------+| NAME | MESSAGE ||-------------+----------------------|| my_reasoner | deleted successfully |+-------------+----------------------+ -
Create a new reasoner with the same name and desired size
Pass the reasoner type, name, and new size to the
api.create_reasoner()procedure to create a new reasoner with the same name and desired size:-- Create a HIGHMEM_X64_M 'logic' reasoner with the same name.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.create_reasoner('logic', 'my_reasoner', 'HIGHMEM_X64_M');Output +-------------+-------+----------------------+| NAME | TYPE | MESSAGE ||-------------+-------+----------------------|| my_reasoner | logic | reasoner created |+-------------+-------+----------------------+
Reasoners cannot be resized on-the-fly. To resize a reasoner, first delete the reasoner and then create a new reasoner with the same name and a different size:
from relationalai.client import connect_sync
with connect_sync() as client: # Delete the reasoner named 'my_reasoner'. client.reasoners.delete("Logic", "my_reasoner")
# Create a HIGHMEM_X64_M Logic reasoner with the same name. client.reasoners.create_ready("Logic", "my_reasoner", reasoner_size="HIGHMEM_X64_M")Reasoners cannot be resized on-the-fly. To resize a reasoner, first delete the reasoner and then create a new reasoner with the same name and a different size:
# Delete the reasoner named 'my_reasoner'.rai reasoners:delete --type logic --name my_reasoner
# Create a HIGHMEM_X64_M reasoner with the same name.rai reasoners:create --type logic --name my_reasoner --size HIGHMEM_X64_M --waitIncrease Maximum Number of Reasoners
Section titled “Increase Maximum Number of Reasoners”Requires the eng_admin application role.
You can allow more reasoners of a given size to run concurrently by increasing the maximum number of compute pool nodes allocated for that reasoner size. Each reasoner of the same size consumes one node from its corresponding compute pool. Note that increasing the maximum number of nodes may increase costs.
Use the api.alter_reasoner_pool_node_limits() procedure to update these limits.
Pass NULL for any value you do not want to change.
To increase only the maximum number of concurrently running HIGHMEM_X64_S reasoners and leave the current minimum unchanged:
-- Increase the maximum concurrent HIGHMEM_X64_S 'logic' reasoners to 12.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.alter_reasoner_pool_node_limits('logic', 'HIGHMEM_X64_S', NULL, 12);+---------+| Success |+---------+To set both a reserved minimum and a higher maximum:
-- Reserve capacity for at least 2 HIGHMEM_X64_M 'logic' reasoners; allow up to 12 concurrently.-- valid reasoner types: 'logic', 'prescriptive', 'predictive'CALL relationalai.api.alter_reasoner_pool_node_limits('logic', 'HIGHMEM_X64_M', 2, 12);+---------+| Success |+---------+To increase the maximum using Python, create a client with connect_sync() and execute the procedure using the client’s SQL executor:
from relationalai.client import connect_sync
with connect_sync() as client: sql = client.core.sql_executor assert sql is not None
# Increase the maximum concurrent HIGHMEM_X64_S 'logic' reasoners to 12 (leave minimum unchanged). sql.collect( "CALL relationalai.api.alter_reasoner_pool_node_limits('logic', 'HIGHMEM_X64_S', NULL, 12)", operation="alter_reasoner_pool_node_limits", )
# Reserve capacity for at least 2 HIGHMEM_X64_S 'logic' reasoners and allow up to 12. sql.collect( "CALL relationalai.api.alter_reasoner_pool_node_limits('logic', 'HIGHMEM_X64_S', 2, 12)", operation="alter_reasoner_pool_node_limits", )Monitor Reasoner Jobs
Section titled “Monitor Reasoner Jobs”Requires the eng_user application role.
You can view a reasoner’s jobs by querying the api.jobs view and filtering by the REASONER_NAME (and optionally REASONER_TYPE) columns:
-- List jobs for the reasoner named 'my_reasoner'.SELECT *FROM relationalai.api.jobsWHERE REASONER_NAME = 'my_reasoner' AND REASONER_TYPE = 'logic';+--------------------------------------+---------------+---------------+---------+----------------------+-------------------------------+-------------------------------+----------+------------------+------------+--------------+| ID | REASONER_TYPE | REASONER_NAME | STATE | CREATED_BY | CREATED_ON | FINISHED_AT | DURATION | PAYLOAD | TIMEOUT_MS | ABORT_REASON ||--------------------------------------+---------------+---------------+---------+----------------------+-------------------------------+-------------------------------+----------+------------------+------------+--------------|| 02c8fa31-1234-5678-90ab-abcdef123456 | logic | my_reasoner | ABORTED | john.doe@company.com | 2024-10-28 08:00:12.123 -0700 | 2024-10-28 08:00:19.766 -0700 | 7643 | {"kind":"query"} | 86400000 | canceled |+--------------------------------------+---------------+---------------+---------+----------------------+-------------------------------+-------------------------------+----------+------------------+------------+--------------+To list jobs using Python, create a client with connect_sync() and call client.jobs.list():
from relationalai.client import connect_sync
with connect_sync() as client: jobs = client.jobs.list("Logic", name="my_reasoner") print(jobs)The RAI CLI exposes RelationalAI jobs as jobs.
To list jobs for a reasoner, pass the reasoner name to the jobs:list command’s --name option:
# List jobs for the reasoner named 'my_reasoner'.rai jobs:list --name my_reasonerNote that multiple jobs for the same reasoner may be in the RUNNING state simultaneously.
See Concurrent Jobs for information on how concurrent jobs are handled.
Take note of the following job states. While occasional occurrences are normal, a high volume may indicate potential issues:
| STATE | Description |
|---|---|
CREATED | The job has been accepted by the native app but has not yet been sent to the reasoner queue. If it remains in this state, the reasoner’s resources may be at capacity, or the native app has not yet forwarded the job to the reasoner. |
QUEUED | The job is in the reasoner’s queue, waiting to be processed. If it remains in this state, the reasoner’s concurrency limit has been reached. Wait for the job to leave the queue or cancel it and rerun on a different reasoner. |
ABORTED | The job was cancelled or failed due to an error. Check the ABORT_REASON column for more details. |
These states indicate that the job is not currently being processed by the reasoner.
For API details about the STATE and ABORT_REASON columns, see the api.jobs SQL reference.
Get Job Details
Section titled “Get Job Details”Requires the eng_user application role.
To get details about a specific job, pass the reasoner type and job ID to the api.get_job() procedure:
-- Get details for the job with ID '02c8fa31-1234-5678-90ab-abcdef123456'.CALL relationalai.api.get_job('logic', '02c8fa31-1234-5678-90ab-abcdef123456');+--------------------------------------+---------------+---------------+---------+----------------------+-------------------------------+-------------------------------+----------+------------------+------------+--------------+| ID | REASONER_TYPE | REASONER_NAME | STATE | CREATED_BY | CREATED_ON | FINISHED_AT | DURATION | PAYLOAD | TIMEOUT_MS | ABORT_REASON ||--------------------------------------+---------------+---------------+---------+----------------------+-------------------------------+-------------------------------+----------+------------------+------------+--------------|| 02c8fa31-1234-5678-90ab-abcdef123456 | logic | my_reasoner | COMPLETED | john.doe@company.com | 2024-10-28 08:00:12.123 -0700 | 2024-10-28 08:00:19.766 -0700 | 7643 | {"kind":"query"} | 86400000 | NULL |+--------------------------------------+---------------+---------------+---------+----------------------+-------------------------------+-------------------------------+----------+------------------+------------+--------------+To get details about a specific job, create a client with connect_sync() and call client.jobs.get():
from relationalai.client import connect_sync
with connect_sync() as client: job = client.jobs.get("Logic", "02c8fa31-1234-5678-90ab-abcdef123456") print(job)To get details about a specific job, pass the job ID to the --id option of the jobs:get command:
# Get details for the job with ID '02c8fa31-1234-5678-90ab-abcdef123456'.rai jobs:get --id 02c8fa31-1234-5678-90ab-abcdef123456Cancel a Job
Section titled “Cancel a Job”Requires the eng_user application role.
To cancel a job, pass the reasoner type and job ID to the api.cancel_job() procedure:
-- Cancel the job with ID '02c8fa31-1234-5678-90ab-abcdef123456'.CALL relationalai.api.cancel_job('logic', '02c8fa31-1234-5678-90ab-abcdef123456');+------------------------+| Cancelling job |+------------------------+To cancel a job, create a client with connect_sync() and call client.jobs.cancel():
from relationalai.client import connect_sync
with connect_sync() as client: client.jobs.cancel("Logic", "02c8fa31-1234-5678-90ab-abcdef123456")To cancel a job, pass the job ID to the --id option of the jobs:cancel command:
# Cancel the job with ID '02c8fa31-1234-5678-90ab-abcdef123456'.rai jobs:cancel --id 02c8fa31-1234-5678-90ab-abcdef123456It may take a few moments for the job to be cancelled.
You may monitor the job and confirm that it has been cancelled once the STATE is reported as CANCELED.