docs/dev-guides/agent-context/snowflake.md
Give Cortex Agents access to your enterprise data context in DataHub — business definitions, ownership, lineage, and quality signals — so they can generate better SQL and answer data questions accurately.
The integration works through UDFs created by the DataHub CLI. Once set up, your Cortex Agent calls DataHub tools alongside your Snowflake tables.
pip install datahub-agent-context[snowflake]ACCOUNTADMIN role (for initial setup)You can either let the CLI execute the SQL directly, or generate the SQL files and run them yourself.
Option A: Execute directly
datahub agent create snowflake \
--sf-account YOUR_ACCOUNT \
--sf-user YOUR_USER \
--sf-password YOUR_PASSWORD \
--sf-role YOUR_ROLE \
--sf-warehouse YOUR_WAREHOUSE \
--sf-database YOUR_DATABASE \
--sf-schema YOUR_SCHEMA \
--datahub-url https://your-datahub.acryl.io \
--datahub-token YOUR_TOKEN \
--enable-mutations \
--execute
Use --sf-authenticator externalbrowser for SSO instead of --sf-password.
Option B: Generate SQL
Drop --execute and --sf-password to generate SQL files instead. Then run them in order in a Snowflake worksheet:
@00_configuration.sql;
@01_network_rules.sql;
@02_datahub_udfs.sql;
@03_stored_procedure.sql;
@04_cortex_agent.sql;
Customize the agent's prompt, model, and tools in the Snowflake UI, then open Snowflake Intelligence and select the DataHub Agent.
<p align="center"> </p>When new tools are released, re-run the UDF and agent SQL:
@02_datahub_udfs.sql;
@04_cortex_agent.sql;
ACCOUNTADMIN. After that, SNOWFLAKE_INTELLIGENCE_ADMIN is sufficient.SHOW USER FUNCTIONS LIKE 'datahub%'; to verify.eyJ).Links: Cortex Agents Docs · Agent Context Kit · MCP Server Guide