Prerequisites
- Python 3.10 or higher
- PraisonAI Agents package installed
tavily-pythonpackage installedTAVILY_API_KEYenvironment variable set
Installation
Setup
Built-in Tavily Tool
PraisonAI provides a built-intavily tool that you can import directly:
Available Functions
| Function | Description |
|---|---|
tavily | Web search (alias for tavily_search) |
tavily_search | Search with full parameters |
tavily_extract | Extract content from URLs |
tavily_crawl | Crawl websites |
tavily_map | Get site maps |
Basic Usage
Simple Search
Search with Options
Extract Content from URLs
Crawl Websites
Get Site Map
With PraisonAI Agent
Using TavilyTools Class
For more control, use theTavilyTools class directly:
Async Usage
Search Parameters
| Parameter | Type | Description |
|---|---|---|
query | str | Search query |
search_depth | str | ”basic” or “advanced” |
topic | str | ”general”, “news”, or “finance” |
max_results | int | Max results (1-20) |
include_answer | bool | Include LLM-generated answer |
include_raw_content | bool | Include full page content |
include_images | bool | Include images |
include_domains | list | Domains to include |
exclude_domains | list | Domains to exclude |
time_range | str | ”day”, “week”, “month”, “year” |
Key Points
- Simple function signature: Tool must accept
query: strand returnstr - Environment variable: Set
TAVILY_API_KEYbefore running - Agent decides: The LLM decides when to use the tool based on the query
- Works globally:
--query-rewriteworks with any PraisonAI command

