Prerequisites
- Python 3.10 or higher
- PraisonAI Agents package installed
tavily-pythonpackage installedTAVILY_API_KEYenvironment variable set
Quick Start
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
Best Practices
Use the simple tavily import
Use the simple tavily import
from praisonaiagents import tavily is the simplest integration - use it unless you need specific parameters.Set search_depth based on task
Set search_depth based on task
Use
search_depth='basic' for quick lookups and 'advanced' for research needing deeper results.Enable include_answer for summaries
Enable include_answer for summaries
Set
include_answer=True to get a Tavily-generated summary alongside raw search results.Use topic filter for domain-specific search
Use topic filter for domain-specific search
Set
topic='news' for current events or topic='finance' for financial queries.Related
Custom Tools
Build your own agent tools
Tools Overview
Browse PraisonAI tool documentation

