Griptape WebSearch Driver: Tavily
A search API built for LLM context, not just links
- DRIVER
Tavily is search-as-an-API built for the RAG crowd - it returns clean, parseable results with optional answer snippets and cleaned page content, which is exactly the shape of data you want to feed an LLM. For a Griptape agent in ComfyUI, this is the middle-of-the-road web search driver: more structured than the free DuckDuckGo default, less exotic than Exa's neural search, and very easy to reason about. If you just want current web results that slot cleanly into a prompt, this is probably the one you should start with.
How it works
The node builds a TavilyWebSearchDriver with a set of inputs that map directly to Tavily's API:
search_depth(defaultbasic) -basicoradvanced. Advanced is deeper and pricier per call; basic is fine for most agent use.topic(defaultgeneral) -generalornews. This one matters more than it looks, because it changes which other fields apply.days(default3) - how far back to search, and the tooltip is explicit: only used whentopicisnews. Set it to 7–30 for real recency windows.max_results(default5) - result count. 5 is genuinely fine for feeding context; you don't need ten links.include_answer(defaultfalse) - Tavily's short direct answer to the query. Cheat code for quick grounding.include_raw_content(defaultfalse) - pulls the cleaned, parsed HTML of each page. Powerful for deep context, expensive, and usually more than you need.include_domains/exclude_domains- multiline filters.api_key_env_var(defaultTAVILY_API_KEY) - the env var name, never the key itself.
Output is DRIVER (WEB_SEARCH_DRIVER), which plugs into the Griptape Web Search tool node - that's the node that actually runs searches against the agent. A nice detail in the source: include_domains and exclude_domains are split on newlines, so each line becomes one domain.
The gotchas
TAVILY_API_KEY is required - the node raises an exception if it's missing, so set it in ComfyUI Settings → Griptape before wiring up. The days field is silently ignored for general topic searches, which trips people into thinking recency filtering is broken. And don't be tempted to flip include_raw_content on everywhere: it roughly multiplies the cost and the token load, and include_answer already gives you most of what you wanted.
Install
Same pack install every time: ComfyUI Manager → search "Griptape" → INSTALL, or git clone https://github.com/griptape-ai/ComfyUI-Griptape into custom_nodes, restart. griptape[all] and python-dotenv come with it, and the README's torch fix is the standard cure if ComfyUI errors after install. Tavily has a free tier with enough credits to learn the whole flow - grab a key at tavily.com and you're searching the web for real in one workflow.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| search_depth | COMBO | basic | The depth of the search |
| topic | COMBO | general | 2 options: general, news |
| days | INT | 3 | The number of days back from the current date to include in the search results. Only when using 'news' search topic. |
| max_results | INT | 5 | The maximum number of search results to return. |
| include_answer | BOOLEAN | false | include a short answer to the search query |
| include_raw_content | BOOLEAN | false | include the cleaned and parsed HTML content |
| include_domains | STRING | A list of domains to include in the search results | |
| exclude_domains | STRING | A list of domains to exclude from the search results | |
| api_key_env_varopt | STRING | TAVILY_API_KEY | The name of the environment variable that contains the API key. Do not include the actual API key here. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DRIVER | WEB_SEARCH_DRIVER | — |