Nodes/ComfyUI Griptape Nodes/Griptape WebSearch Driver: Tavily
ComfyUI Node

Griptape WebSearch Driver: Tavily

A search API built for LLM context, not just links

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape WebSearch Driver: Tavily
    • DRIVER
    search_depthbasic
    topicgeneral
    days3
    max_results5
    include_answerfalse
    include_raw_contentfalse
    include_domains
    exclude_domains
    api_key_env_varTAVILY_API_KEY

    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 (default basic) - basic or advanced. Advanced is deeper and pricier per call; basic is fine for most agent use.
    • topic (default general) - general or news. This one matters more than it looks, because it changes which other fields apply.
    • days (default 3) - how far back to search, and the tooltip is explicit: only used when topic is news. Set it to 7–30 for real recency windows.
    • max_results (default 5) - result count. 5 is genuinely fine for feeding context; you don't need ten links.
    • include_answer (default false) - Tavily's short direct answer to the query. Cheat code for quick grounding.
    • include_raw_content (default false) - 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 (default TAVILY_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.

    CategoryGriptape/Agent Drivers/Web Search

    Inputs (9)

    NameTypeDefaultDescription
    search_depthCOMBObasicThe depth of the search
    topicCOMBOgeneral2 options: general, news
    daysINT3The number of days back from the current date to include in the search results. Only when using 'news' search topic.
    max_resultsINT5The maximum number of search results to return.
    include_answerBOOLEANfalseinclude a short answer to the search query
    include_raw_contentBOOLEANfalseinclude the cleaned and parsed HTML content
    include_domainsSTRINGA list of domains to include in the search results
    exclude_domainsSTRINGA list of domains to exclude from the search results
    api_key_env_varoptSTRINGTAVILY_API_KEYThe name of the environment variable that contains the API key. Do not include the actual API key here.

    Outputs (1)

    NameTypeDescription
    DRIVERWEB_SEARCH_DRIVER