> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modulex.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Tavily Search Integration for AI Agents & Workflows

> AI-powered web search engine with advanced search capabilities, answer generation, and news search

{/* Self-hosted logo — build-time vendored from modulex.json / Iconify (see scripts/lib/logo.js). */}

<img src="https://mintcdn.com/modulexaillc/df8MOr-hXotYLTh5/logos/tavily.svg?fit=max&auto=format&n=df8MOr-hXotYLTh5&q=85&s=1b82cc40b9037381572b5ba161e49615" alt="Tavily Search logo" width="72" height="72" data-path="logos/tavily.svg" />

## Overview

Add **Tavily Search** to any ModuleX agent or workflow. AI-powered web search using the official [`langchain-tavily`](https://pypi.org/project/langchain-tavily/) SDK. First SDK-based integration in the package — the @tools wrap `TavilySearch` rather than calling Tavily's HTTP API directly.

<Info>
  **Categories**: Web Search & Scraping · Research · Ai · **Auth**: API Key, ModuleX Managed Key · **Actions**: 3
</Info>

## Authentication

<Tabs>
  <Tab title="API Key">
    ### API Key Authentication

    Authenticate using your Tavily API key

    #### Required Credentials

    | Field          | Description                            | Required | Format                                  |
    | -------------- | -------------------------------------- | -------- | --------------------------------------- |
    | Tavily API Key | Your Tavily API key for authentication | Yes      | `tvly-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
  </Tab>

  <Tab title="ModuleX Managed Key">
    ### ModuleX Managed Key

    Use ModuleX's managed API keys with usage tracked against your weekly credit limit
  </Tab>
</Tabs>

## Available Actions

<AccordionGroup>
  <Accordion title="web_search — Performs comprehensive web search using Tavily's AI-powered search engine">
    ### Parameters

    <ResponseField name="query" type="string" required>
      Search query
    </ResponseField>

    <ResponseField name="max_results" type="integer">
      Maximum number of results to return (1-20) (Default: `5`)
    </ResponseField>

    <ResponseField name="search_depth" type="string">
      Search depth: basic (faster) or advanced (thorough) (Default: `basic`)
    </ResponseField>

    <ResponseField name="include_domains" type="array">
      List of domains to specifically include in search results
    </ResponseField>

    <ResponseField name="exclude_domains" type="array">
      List of domains to specifically exclude from search results
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "TavilyResult": {
          "additionalProperties": false,
          "description": "One row in a Tavily search response.",
          "properties": {
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Title"
            },
            "content": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Content"
            },
            "score": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Score"
            },
            "raw_content": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Raw Content"
            }
          },
          "title": "TavilyResult",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "query": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Query"
        },
        "answer": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Answer"
        },
        "results": {
          "items": {
            "$ref": "#/$defs/TavilyResult"
          },
          "title": "Results",
          "type": "array"
        },
        "images": {
          "items": {
            "type": "string"
          },
          "title": "Images",
          "type": "array"
        },
        "response_time": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Response Time"
        },
        "request_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Request Id"
        }
      },
      "required": [
        "success"
      ],
      "title": "WebSearchOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="answer_search — Performs web search and generates a direct AI answer to the query with supporting sources">
    ### Parameters

    <ResponseField name="query" type="string" required>
      Question or search query
    </ResponseField>

    <ResponseField name="max_results" type="integer">
      Maximum number of supporting results to return (Default: `5`)
    </ResponseField>

    <ResponseField name="search_depth" type="string">
      Search depth: basic or advanced (Default: `advanced`)
    </ResponseField>

    <ResponseField name="include_domains" type="array">
      List of domains to specifically include
    </ResponseField>

    <ResponseField name="exclude_domains" type="array">
      List of domains to exclude
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "TavilyResult": {
          "additionalProperties": false,
          "description": "One row in a Tavily search response.",
          "properties": {
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Title"
            },
            "content": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Content"
            },
            "score": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Score"
            },
            "raw_content": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Raw Content"
            }
          },
          "title": "TavilyResult",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "query": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Query"
        },
        "answer": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Answer"
        },
        "results": {
          "items": {
            "$ref": "#/$defs/TavilyResult"
          },
          "title": "Results",
          "type": "array"
        },
        "images": {
          "items": {
            "type": "string"
          },
          "title": "Images",
          "type": "array"
        },
        "response_time": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Response Time"
        },
        "request_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Request Id"
        }
      },
      "required": [
        "success"
      ],
      "title": "AnswerSearchOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="news_search — Searches recent news articles using Tavily's specialized news search">
    ### Parameters

    <ResponseField name="query" type="string" required>
      News search query
    </ResponseField>

    <ResponseField name="max_results" type="integer">
      Maximum number of news articles to return (Default: `5`)
    </ResponseField>

    <ResponseField name="days" type="integer">
      Number of days back to search (1-365) (Default: `3`)
    </ResponseField>

    <ResponseField name="include_domains" type="array">
      News domains to include (e.g., reuters.com, bbc.com)
    </ResponseField>

    <ResponseField name="exclude_domains" type="array">
      News domains to exclude
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "TavilyResult": {
          "additionalProperties": false,
          "description": "One row in a Tavily search response.",
          "properties": {
            "url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Url"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Title"
            },
            "content": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Content"
            },
            "score": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Score"
            },
            "raw_content": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Raw Content"
            }
          },
          "title": "TavilyResult",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "query": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Query"
        },
        "results": {
          "items": {
            "$ref": "#/$defs/TavilyResult"
          },
          "title": "Results",
          "type": "array"
        },
        "images": {
          "items": {
            "type": "string"
          },
          "title": "Images",
          "type": "array"
        },
        "response_time": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Response Time"
        },
        "request_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Request Id"
        }
      },
      "required": [
        "success"
      ],
      "title": "NewsSearchOutput",
      "type": "object"
    }
    ```
  </Accordion>
</AccordionGroup>

## Limits & Quotas

* Tavily's rate limit varies by plan; consult their dashboard.
* The SDK is imported **lazily** inside each tool: if
  `langchain-tavily` is not installed, the tool returns
  `success=False` with an "install with pip install langchain-tavily"
  message rather than crashing. This matches legacy modulex behavior.

## Related integrations

<CardGroup cols={3}>
  <Card title="Jina AI" href="/integrations/tools/jina-ai" />

  <Card title="Ahrefs" href="/integrations/tools/ahrefs" />

  <Card title="Airweave" href="/integrations/tools/airweave" />
</CardGroup>

## Links

* [Tavily Search](https://tavily.com)
