Skip to content

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.

Minimum role: CUBE_ADMIN

SETUP_AI(WAREHOUSE_NAME) -> OBJECT

Configures AI features for the application.

Parameter Type Req/Opt Description
WAREHOUSE_NAME VARCHAR req Warehouse for AI operations.
CALL CUBE.SETUP_AI('MY_WAREHOUSE');

Minimum role: CUBE_PUBLIC

GET_AGENT_DDL(
AGENT_TYPE,
TARGET_SCHEMA,
WAREHOUSE
) -> VARCHAR

Generates DDL for creating a Cortex Agent over your cubes. The procedure returns SQL for you to review and run.

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.
CALL CUBE.GET_AGENT_DDL(
NULL,
'MY_SCHEMA',
'MY_WAREHOUSE'
);

Minimum role: CUBE_ADMIN

SETUP_MCP_SERVER(
P_DATABASE,
P_SCHEMA,
P_WAREHOUSE
) -> OBJECT

Creates an MCP server that exposes the cube to external AI assistants that support the Model Context Protocol.

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.
CALL CUBE.SETUP_MCP_SERVER(
'MY_DB',
'MY_SCHEMA',
'MY_WAREHOUSE'
);

Minimum role: CUBE_ADMIN

GENERATE_COCO_SKILL(P_CUBE_NAME) -> VARCHAR

Produces 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.

Parameter Type Req/Opt Description
P_CUBE_NAME VARCHAR req Cube to describe.

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.

CALL CUBE.GENERATE_COCO_SKILL('FINANCE');