Prerequisites
- Python 3.10 or higher
- PraisonAI Agents package installed
tavily-pythonpackage installedTAVILY_API_KEYenvironment variable set
Quick Start
1
Install and set key
2
Search with agent
Installation
Setup
Built-in Tavily Tool
PraisonAI provides a built-intavily tool that you can import directly:
Available Functions
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
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

