Tavily Search and Extract Tools for AI Applications

This page covers Tavily, a search API for AI apps, and its integration via OpenClaw's web_search provider and dedicated plugin tools. It is intended for developers needing structured search results, content extraction, and AI-generated summaries.

Read this when

  • You want Tavily-backed web search
  • You need a Tavily API key
  • You want Tavily as a web_search provider
  • You want content extraction from URLs

Tavily is a search API built for AI applications. OpenClaw makes it available through two interfaces:

  • the web_search provider within the generic search tool
  • dedicated plugin tools: tavily_search and tavily_extract

Tavily delivers structured results tailored for LLM consumption, offering adjustable search depth, topic filtering, domain restrictions, AI-generated answer summaries, and URL content extraction (including JavaScript-rendered pages).

PropertyValue
Plugin idtavily
Package@openclaw/tavily-plugin
AuthTAVILY_API_KEY env var or config apiKey
Base URLhttps://api.tavily.com (default); TAVILY_BASE_URL env var or config baseUrl to override
Timeouts30s search, 60s extract (default)
Toolstavily_search, tavily_extract

Getting started

Install the plugin

openclaw plugins install @openclaw/tavily-plugin

Get an API key

Sign up for a Tavily account at tavily.com and then generate an API key from the dashboard.

Configure the plugin and provider

{
  plugins: {
    entries: {
      tavily: {
        enabled: true,
        config: {
          webSearch: {
            apiKey: "tvly-...", // optional if TAVILY_API_KEY is set
            baseUrl: "https://api.tavily.com",
          },
        },
      },
    },
  },
  tools: {
    web: {
      search: {
        provider: "tavily",
      },
    },
  },
}

Verify search runs

Run a web_search from any agent, or invoke tavily_search directly.

Tip

Selecting Tavily during onboarding or in openclaw configure --section web installs and activates the official Tavily plugin as needed.

Tool reference

Use this when you need Tavily-specific search controls rather than the generic web_search.

ParameterTypeConstraints / defaultDescription
querystringrequiredSearch query string.
search_depthenumbasic (default), advancedadvanced is slower but higher relevance.
topicenumgeneral (default), news, financeFilter by topic family.
max_resultsinteger1-20, default 5Number of results.
include_answerbooleandefault falseInclude a Tavily AI-generated answer summary.
time_rangeenumday, week, month, yearFilter results by recency.
include_domainsstring array(none)Only include results from these domains.
exclude_domainsstring array(none)Exclude results from these domains.

Search depth tradeoff:

DepthSpeedRelevanceBest for
basicFasterHighGeneral-purpose queries (default).
advancedSlowerHighestPrecision research and fact-finding.

tavily_extract

Employ this to pull clean content from one or more URLs. It handles JavaScript-rendered pages and supports query-focused chunking for targeted extraction.

ParameterTypeConstraints / defaultDescription
urlsstring arrayrequired, 1-20URLs whose content should be extracted.
querystring(optional)Reorder extracted chunks based on relevance to this query.
extract_depthenumbasic (default), advancedPick advanced for JavaScript-heavy pages, single-page apps, or dynamic tables.
chunks_per_sourceinteger1-5; requires queryNumber of chunks returned per URL. Fails if query is missing.
include_imagesbooleandefault falseWhether to include image URLs in the output.

Extract depth tradeoff:

DepthWhen to use
basicSimple pages. Start here.
advancedJS-rendered SPAs, dynamic content, tables.

Tip

Split large URL batches across several tavily_extract calls (20 per request max). Combine query with chunks_per_source to pull only relevant content instead of entire pages.

Choosing the right tool

NeedTool
Quick web search, no special optionsweb_search
Search with depth, topic, AI answerstavily_search
Extract content from specific URLstavily_extract

Note

The generic web_search tool using Tavily as its provider supports query and count (up to 20 results). For Tavily-specific parameters (search_depth, topic, include_answer, domain filters, time range), go with tavily_search instead.

Advanced configuration

API key resolution order

The Tavily client checks for an API key in this sequence:

  1. plugins.entries.tavily.config.webSearch.apiKey (resolved via SecretRefs).
  2. TAVILY_API_KEY from the gateway environment.

If neither is available, both tavily_search and tavily_extract raise a setup error.

Custom base URL

Override plugins.entries.tavily.config.webSearch.baseUrl, or configure TAVILY_BASE_URL, when routing Tavily through a proxy. The config value takes precedence over the environment variable. The fallback is https://api.tavily.com.

chunks_per_source requires query

tavily_extract rejects requests that supply chunks_per_source without a query. Tavily orders chunks by relevance to the query, so the parameter has no purpose without one.

848 words · updated Jul 27, 2026