Skip to main content
The TavilySearch tool lets an agent run AI-optimised web search through the Tavily API.

Overview

The TavilySearch tool is a tool that allows you to search the web using the TavilySearch.

How It Works

Getting Started

1

Simple Usage

  1. Install dependencies (see Overview above)
  2. Set required API keys in your environment
  3. Run the agent example in Overview
2

With Configuration

Use the same tool with an agent — see the Overview example, or pass env vars from the sections above.

Best Practices

Set TAVILY_API_KEY in your shell or .env. The tool reads it automatically — never hard-code the key.
TavilySearchResults(max_results=5) controls how many hits return. Lower it so the agent processes fewer tokens.
Set include_answer=True when the agent needs a synthesised answer rather than raw links — it saves a follow-up LLM step.

Tavily

Tavily tool (praisonai-tools)

Exa Search

Exa LangChain integration

DuckDuckGo

Privacy-focused search