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_namestr) - Unique name for the Cortex agent within its schema.
(tools_schemastr) - Fully-qualifiedDATABASE.SCHEMAthat holds the agent’s stored procedures and stage, and the agent itself unlessagent_schemais set. Keep it separate from the model’s deployment schema.
(model_deploymentModelDeployment) - Where the one model registered byinit_toolswas deployed with PyRel deploy mode. The model runs against it with default settings; its own config andraiconfig.yamlare not used.deploy()andupdate()apply this to the model objectinit_toolsreturns, so after either call that in-process model reads the deployment too.
(warehousestr, 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_namestr, default:“rai_sprocs”) - Name of the Snowflake stage for storing sproc dependencies. Default:"rai_sprocs".
(manage_stagebool, default:True) - IfTrue, automatically create/drop the stage during deploy/cleanup. Set toFalseif using a pre-existing stage. Default:True.
(llmstr, 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_sint, default:300) - Timeout in seconds for stored procedure execution. Default: 300.
(artifact_repositorystr, 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_secondsint, default:None) - Time budget in seconds for agent execution. If specified, the agent will terminate when this limit is hit. Can be used withbudget_tokens.
(budget_tokensint, default:None) - Token budget for model consumption. If specified, the agent will terminate when this limit is hit. Can be used withbudget_seconds.
(allow_previewbool, default:False) - Allow Preview capabilities (e.g., queries). Default:False.
(agent_schemastr, default:None) - Fully-qualifiedDATABASE.SCHEMAwhere the agent is created. Sprocs and stage remain intools_schema. UseSNOWFLAKE_INTELLIGENCE.AGENTSto 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 intools_schema).
(procedure_prefixstr, default:None) - Prefix applied to the stored-procedure names, isolating this agent’s tools from others deployed to the sametools_schema. WhenNone(the default), procedure names are unprefixed (RAI_DISCOVER_MODEL, …). When set (e.g."SALES"), the procedures becomeSALES_RAI_DISCOVER_MODEL, etc., while the agent-facing tool names stay unchanged. Prefer a dedicatedtools_schemaper agent when possible; useprocedure_prefixonly 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",)