Skip to content

feat: add web_search_tool config option to cortex_agent materialization - #13

Merged
Matts52 merged 1 commit into
mainfrom
pangyo
Jul 24, 2026
Merged

feat: add web_search_tool config option to cortex_agent materialization#13
Matts52 merged 1 commit into
mainfrom
pangyo

Conversation

@Matts52

@Matts52 Matts52 commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #11.

Adds a web_search_tool boolean config key (default false) to the cortex_agent materialization. When enabled, the generated DDL includes a TOOLS clause with the WEB_SEARCH_TOOL entry — no resource binding required.

Usage:

{{ config(
    materialized    = 'cortex_agent',
    web_search_tool = true
) }}

Compiles to:

create or replace agent MY_DB.MY_SCHEMA.MY_AGENT
tools = (
  { TYPE = WEB_SEARCH_TOOL, NAME = 'web_search' }
)
from specification
$$
...
$$

Setting web_search_tool = false or omitting it produces no TOOLS clause.

Changes

  • macros/relations/cortex_agent/create.sql — build a tools_list in spec mode; append the web search entry when enabled; render TOOLS = (...) only when the list is non-empty
  • integration_tests/models/agent_with_web_search.sql — new integration test model exercising the new config
  • integration_tests/macros/assert_agents_exist.sql — add agent_with_web_search to the expected agent list
  • README.md — document web_search_tool in the config reference table and add a "Enabling web search" usage section

Test plan

  • dbt compile on the new agent_with_web_search model and verify the compiled SQL contains the TOOLS = ( { TYPE = WEB_SEARCH_TOOL, NAME = 'web_search' } ) clause
  • Verify existing models without web_search_tool produce no TOOLS clause
  • Run dbt build --target snowflake in integration_tests/ and confirm all agents are created
  • Run dbt run-operation assert_agents_exist --target snowflake and confirm agent_with_web_search passes

🤖 Generated with Claude Code

…on (closes #11)

Adds a boolean `web_search_tool` config key (default false) that, when true,
appends `{ TYPE = WEB_SEARCH_TOOL, NAME = 'web_search' }` to a DDL-level
TOOLS clause in the generated CREATE OR REPLACE AGENT statement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Matts52
Matts52 merged commit 337414e into main Jul 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add web_search_tool config option to cortex_agent materialization

1 participant