Griptape WebSearch Driver: Google
Give your agent real web search — but it needs two API keys
- DRIVER
The Google WebSearch driver is how your Griptape agent actually looks things up on the live web. Without a web-search driver, an agent that claims to "research" is just reasoning from its training data - confident, fluent, and sometimes wrong about anything that happened last month. Wire this in and the agent can call out to Google, pull real results, and feed them into its reasoning. It's the difference between an agent that talks about the web and one that reads it.
The node's own description sets the requirement plainly: "Requires environment variables GOOGLE_API_KEY and GOOGLE_API_SEARCH_ID." That second one is the gotcha most people miss. GOOGLE_API_KEY you get from Google Cloud, but GOOGLE_API_SEARCH_ID is the ID of a Programmable Search Engine - you have to create one in the CSE console for this to work at all. It's not a second secret so much as a second configuration step.
How it works
The node wraps Griptape's GoogleWebSearchDriver. It reads both values from the environment variables you name, builds the driver with your region/language/result-count settings, and hands you a WEB_SEARCH_DRIVER. That feeds a web-search tool - in this pack that's Griptape Tool: WebSearch - which the agent then uses as a callable skill. If either credential is missing, the node raises a clear error telling you which one you forgot, which is more helpful than most.
The inputs that matter
- country - country code for results, default
us. - language - language code, default
en. - results_count - how many results per search, default 5.
- api_key_env_var - env var name for your Google API key, default
GOOGLE_API_KEY. - search_id_env_var - env var name for the CSE ID, default
GOOGLE_API_SEARCH_ID.
Output is a single WEB_SEARCH_DRIVER. As always with this pack, the *_env_var fields take variable names, never the literal values.
Install and credentials
Same pack, same install - ComfyUI Manager (search "Griptape") or:
cd ComfyUI/custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape
Then two setup steps: enable the Custom Search JSON API and create a key in Google Cloud, and create a Programmable Search Engine to get the cx search ID. Set both in Settings → Griptape or your environment. The free tier of the Custom Search JSON API is real but quota-limited - 100 queries a day or so - which is plenty for personal agent use and vanishes fast if you loop it.
Common gotchas
The search ID is the classic failure point: people set GOOGLE_API_KEY, forget the CSE entirely, and get "Google API Search ID not found" forever. Both are required. Also worth knowing: if you only need occasional, no-credential search, the pack's DuckDuckGo driver is the free alternative - Google is the one to reach for when you want reliable, quota-backed results (DDG rate-limits harder). And if your agent's answers still look stale, check that the web-search tool is actually wired into the agent's tools list, not just that the driver exists in the graph.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| country | STRING | us | Country code for the search results. |
| language | STRING | en | Language code for the search results. |
| results_count | INT | 5 | Number of search results to return. |
| api_key_env_varopt | STRING | GOOGLE_API_KEY | Environment variable name for the Google API key. Do not use your actual API key here. |
| search_id_env_varopt | STRING | GOOGLE_API_SEARCH_ID | Environment variable name for the Google API Search ID. Do not use your actual API Search ID here. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DRIVER | WEB_SEARCH_DRIVER | — |