Skip to content

AgentConfig

relationalai.agent.cortex.deployment_config
AgentConfig(
agent_name: str,
tools_schema: str,
model_deployment: ModelDeployment,
warehouse: Optional[str] = None,
stage_name: str = "rai_sprocs",
manage_stage: bool = True,
llm: str = DEFAULT_LLM,
query_timeout_s: int = 300,
artifact_repository: str = "snowflake.snowpark.pypi_shared_repository",
budget_seconds: Optional[int] = None,
budget_tokens: Optional[int] = None,
allow_preview: bool = False,
agent_schema: Optional[str] = None,
procedure_prefix: Optional[str] = None,
)

Configuration for a Cortex agent that serves one PyRel deploy-mode model.

The Snowflake identifier fields below (tools_schema, warehouse, stage_name, artifact_repository, and agent_schema) follow Snowflake’s identifier casing rules: an unquoted name is resolved in uppercase, while a double-quoted name is matched exactly. Double-quote a name only when the Snowflake object was created with a lowercase or mixed-case name.

Parameters

  • agent_name

    (str) - Unique name for the Cortex agent within its schema.
  • tools_schema

    (str) - Fully-qualified DATABASE.SCHEMA that holds the agent’s stored procedures and stage, and the agent itself unless agent_schema is set. Keep it separate from the model’s deployment schema.
  • model_deployment

    (ModelDeployment) - Where the one model registered by init_tools was deployed with PyRel deploy mode. The model runs against it with default settings; its own config and raiconfig.yaml are not used. deploy() and update() apply this to the model object init_tools returns, so after either call that in-process model reads the deployment too.
  • warehouse

    (str, default: None) - Snowflake warehouse the Cortex agent will use when executing RAI tools. If provided, SI users need USAGE on this warehouse. If not provided, tools use the caller’s session warehouse. Stored procedures are created with CALLER’S RIGHTS.
  • stage_name

    (str, default: “rai_sprocs”) - Name of the Snowflake stage for storing sproc dependencies. Default: "rai_sprocs".
  • manage_stage

    (bool, default: True) - If True, automatically create/drop the stage during deploy/cleanup. Set to False if using a pre-existing stage. Default: True.
  • llm

    (str, default: DEFAULT_LLM) - Language model to use for agent orchestration. Must be a model available in Snowflake Cortex. Default: "claude-opus-4-6".
  • query_timeout_s

    (int, default: 300) - Timeout in seconds for stored procedure execution. Default: 300.
  • artifact_repository

    (str, default: “snowflake.snowpark.pypi_shared_repository”) - Snowflake artifact repository required at sproc runtime for Python package resolution. Established by the default RAI installation. Default: "snowflake.snowpark.pypi_shared_repository".
  • budget_seconds

    (int, default: None) - Time budget in seconds for agent execution. If specified, the agent will terminate when this limit is hit. Can be used with budget_tokens.
  • budget_tokens

    (int, default: None) - Token budget for model consumption. If specified, the agent will terminate when this limit is hit. Can be used with budget_seconds.
  • allow_preview

    (bool, default: False) - Allow Preview capabilities (e.g., queries). Default: False.
  • agent_schema

    (str, default: None) - Fully-qualified DATABASE.SCHEMA where the agent is created. Sprocs and stage remain in tools_schema. Use SNOWFLAKE_INTELLIGENCE.AGENTS to expose the agent in the Snowflake Intelligence UI. Agents created outside that schema can still be promoted through the UI. Default: None (agent is created in tools_schema).
  • procedure_prefix

    (str, default: None) - Prefix applied to the stored-procedure names, isolating this agent’s tools from others deployed to the same tools_schema. When None (the default), procedure names are unprefixed (RAI_DISCOVER_MODEL, …). When set (e.g. "SALES"), the procedures become SALES_RAI_DISCOVER_MODEL, etc., while the agent-facing tool names stay unchanged. Prefer a dedicated tools_schema per agent when possible; use procedure_prefix only for restricted environments where that is not available. Should be a valid Snowflake identifier fragment.

Examples

config = AgentConfig(
agent_name="jaffle_assistant",
tools_schema="APPS.JAFFLE_TOOLS",
model_deployment=ModelDeployment(schema="APPS.JAFFLE"),
warehouse="COMPUTE_WH",
)

Used By