Skip to main content
Bring Nimble’s web data into Snowflake as scalar SQL UDFs, then wire them into a Cortex Agent so any Snowflake Intelligence chat (or any caller of the agent run REST API) can search the web and pull live page content alongside your warehouse data.

What you get

  • NIMBLE_SEARCH and NIMBLE_EXTRACT callable inline from any Snowflake SQL. Pipelines, notebooks, Streamlit, dbt — usable directly in SELECT, views, and joins because the UDFs return VARIANT.
  • A pre-built Cortex Agent wired to those tools, invocable from Snowflake Intelligence or the agent run REST API
  • Stays inside your Snowflake account. Only authorized outbound calls hit Nimble.
  • One-time setup, run by ACCOUNTADMIN. Under 5 minutes.

Prerequisites

  • ACCOUNTADMIN role
  • Snowflake Enterprise edition or higher
  • A Nimble API key (sign up free)

Install Nimble in Snowflake

1

Create the role, database, and dedicated warehouse

Set up an isolated namespace for the integration. A dedicated warehouse keeps agent traffic separate from analytics workloads and makes cost attribution trivial.

cookbook/snowflake/setup/setup.sql

Full setup script: role, grants, database, schema, warehouse
2

Authorize outbound traffic to Nimble

Create a network rule, store your Nimble API key as a Snowflake secret, and bind both into an External Access Integration. The UDFs reference the EAI to make outbound HTTPS calls.

cookbook/snowflake/setup/setup.sql

Network rule, secret, and External Access Integration block
3

Deploy NIMBLE_SEARCH

A Python UDF that calls Nimble’s Search API and returns the response as a VARIANT. Callers navigate the JSON inline with :field syntax — no PARSE_JSON() needed.

cookbook/snowflake/cortex-agent-tools/01_nimble_search.sql

Full UDF with focus, depth, country, locale, and domain filters
4

Deploy NIMBLE_EXTRACT

Same shape as NIMBLE_SEARCH. Takes a single URL and returns the parsed page content as a VARIANT.

cookbook/snowflake/cortex-agent-tools/02_nimble_extract.sql

Full UDF with driver, country, locale, and format selection
5

Register the Cortex Agent

Wire both UDFs into a Cortex Agent. tool_spec.type: generic declares each tool’s JSON schema; tool_resources maps the schema to the underlying function (type: function) and the warehouse that runs it.

cookbook/snowflake/cortex-agent-tools/03_cortex_agent.sql

Full agent spec, including grants and verification queries

Try these recipes

Recipe 1: Quick search and extract from SQL

Both UDFs return VARIANT. Navigate the response inline with :field syntax — no CALL, no PARSE_JSON, no RESULT_SCAN.
Because the UDFs are scalar and return VARIANT, they slot directly into views, dbt models, FLATTEN calls, and joins against warehouse data — no two-step CALL + RESULT_SCAN + PARSE_JSON workaround.

Recipe 2: CPG retailer price and availability monitoring

A CPG brand keeps its product master in Snowflake and wants daily competitive intelligence on how its SKUs appear across Amazon, Walmart, and Target. Nimble Search finds the listing URL per SKU per retailer; Nimble Extract pulls price, stock, and reviews from each listing; the enriched rows land in a PRODUCT_LISTINGS table that BI can read. Input: PRODUCTS Output: PRODUCT_LISTINGS A v_price_alerts view layers on top, surfacing SKUs with a 10%+ price drop versus the trailing seven-day median (or any retailer flipping to out-of-stock), and feeds the daily competitive briefing.

cookbook/snowflake/recipes/cpg_price_monitoring/

Full recipe: sample data, enrichment SQL, the alerts view, and the daily task

Recipe 3: Chat with the agent in Snowflake Intelligence

The fastest way to try the agent is the Snowflake Intelligence UI:
1

Open Snowflake Intelligence

From Snowsight, open AI & ML → Snowflake Intelligence.
2

Pick the agent

Select NIMBLE_WEB_RESEARCH_AGENT from the agent picker. The two tools (nimble_search, nimble_extract) appear in the tool tray.
3

Ask a research question

Try a prompt that forces both tools. For example: “Find the three most recent posts on Snowflake’s engineering blog about Cortex, then pull the full text of each.” The agent calls nimble_search, picks URLs from the results, then calls nimble_extract to retrieve page content, and answers with citations.
Need to call the agent programmatically? The same agent is reachable via the Cortex Agents REST API: POST to /api/v2/databases/{db}/schemas/{schema}/agents/NIMBLE_WEB_RESEARCH_AGENT:run with a message body. Useful for Streamlit apps, scheduled tasks, or wiring the agent into an external orchestrator.

Recipe 4: Schedule recurring enrichment

Wrap the CPG enrichment in a Snowflake task so it runs every morning before the business day. The task uses the same NIMBLE_AGENT_WH warehouse and writes incrementally to PRODUCT_LISTINGS.

cookbook/snowflake/recipes/cpg_price_monitoring/schedule.sql

Full scheduled task: incremental load, retry policy, and dead-letter handling

Roll out across your organization

  • Grant scoped access. Grant nimble_role to the specific user roles or service accounts that should call the UDFs, not to PUBLIC. The role already carries SNOWFLAKE.CORTEX_USER, so grantees can invoke the agent without any extra Cortex grant.
  • Tune for your Nimble rate-limit tier. The cookbook enrichment proc accepts a max_workers parameter for concurrent extraction. Start at 4 and raise it as your tier allows; Nimble’s rate-limits page lists per-tier ceilings.
  • Right-size the warehouse. XSMALL with 60-second auto-suspend is fine for interactive agent chat. For large batch enrichment (thousands of SKUs), step up to SMALL or MEDIUM only for the duration of the scheduled task; suspend cost is negligible at this size.
  • Contain cost during dev. Use TABLESAMPLE on the source table when iterating on enrichment logic, and monitor spend via the TASK_HISTORY and WAREHOUSE_METERING_HISTORY views.
  • Pre-approve the agent in shared workspaces. When sharing Snowflake Intelligence workspaces, add NIMBLE_WEB_RESEARCH_AGENT to the workspace’s allowed agent list so collaborators can invoke it without re-granting access.

Resources

Nimbleway/cookbook (snowflake/)

Every SQL file referenced on this page, plus the CPG recipe

Nimble Search API

Request shape, parameters, and response schema for NIMBLE_SEARCH

Nimble Extract API

Request shape, parameters, and response schema for NIMBLE_EXTRACT

Snowflake External Access Integration

How Snowflake gates outbound HTTPS from UDFs and stored procedures

Snowflake Cortex Agents

Overview of the Cortex Agents runtime and orchestration model

CREATE AGENT reference

Full SQL reference for the agent spec used in Step 5