AI Integration
The procedures in this section configure AI integration for Casabase Cube.
All procedures in this section require SNOWFLAKE.CORTEX_USER to be granted to the application. Cortex runs inside the Snowflake account, so these procedures do not introduce an external connection.
SETUP_AI
Section titled “SETUP_AI”Minimum role: CUBE_ADMIN
SETUP_AI(WAREHOUSE_NAME) -> OBJECTConfigures AI features for the application.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
WAREHOUSE_NAME |
VARCHAR |
req | Warehouse for AI operations. |
Example
Section titled “Example”CALL CUBE.SETUP_AI('MY_WAREHOUSE');GET_AGENT_DDL
Section titled “GET_AGENT_DDL”Minimum role: CUBE_PUBLIC
GET_AGENT_DDL( AGENT_TYPE, TARGET_SCHEMA, WAREHOUSE) -> VARCHARGenerates DDL for creating a Cortex Agent over your cubes. The procedure returns SQL for you to review and run.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
AGENT_TYPE |
VARCHAR |
opt | Agent type to generate. |
TARGET_SCHEMA |
VARCHAR |
opt | Schema in which to create the agent. |
WAREHOUSE |
VARCHAR |
opt | Warehouse for the agent. |
Example
Section titled “Example”CALL CUBE.GET_AGENT_DDL( NULL, 'MY_SCHEMA', 'MY_WAREHOUSE');SETUP_MCP_SERVER
Section titled “SETUP_MCP_SERVER”Minimum role: CUBE_ADMIN
SETUP_MCP_SERVER( P_DATABASE, P_SCHEMA, P_WAREHOUSE) -> OBJECTCreates an MCP server that exposes the cube to external AI assistants that support the Model Context Protocol.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
P_DATABASE |
VARCHAR |
req | Database for the MCP server. |
P_SCHEMA |
VARCHAR |
req | Schema for the MCP server. |
P_WAREHOUSE |
VARCHAR |
opt | Warehouse for execution. |
Example
Section titled “Example”CALL CUBE.SETUP_MCP_SERVER( 'MY_DB', 'MY_SCHEMA', 'MY_WAREHOUSE');GENERATE_COCO_SKILL
Section titled “GENERATE_COCO_SKILL”Minimum role: CUBE_ADMIN
GENERATE_COCO_SKILL(P_CUBE_NAME) -> VARCHARProduces a ready-made agent skill definition for a cube so that a coding agent or AI assistant can query it without first being taught the Casabase Cube query syntax.
The generated skill includes the cube’s dimensions, POV operators, and worked query examples.
Parameters
Section titled “Parameters”| Parameter | Type | Req/Opt | Description |
|---|---|---|---|
P_CUBE_NAME |
VARCHAR |
req | Cube to describe. |
Returns
Section titled “Returns”Returns the skill definition as text for you to review and save.
The procedure does not install or register the generated skill on your behalf.
Example
Section titled “Example”CALL CUBE.GENERATE_COCO_SKILL('FINANCE');