--- name: tavily-search description: Tavily AI Search API integration for high-quality search results optimized for LLMs and RAG applications. Use when the user needs to search the web with Tavily's AI-powered search engine, which provides structured results with summaries, sources, and relevance scores. Particularly useful for research, fact-checking, and gathering up-to-date information from the web. --- # Tavily Search Integration with [Tavily](https://tavily.com) AI Search API - a search engine built specifically for AI applications. ## Prerequisites 1. Get a Tavily API key from https://tavily.com 2. Configure the key via **environment variable**: ```bash export TAVILY_API_KEY=your_key_here ``` Add to `~/.bashrc` or `~/.zshrc` for persistence: ```bash echo 'export TAVILY_API_KEY=your_key_here' >> ~/.bashrc source ~/.bashrc ``` 3. Or pass `api_key` as a direct parameter when calling the function ## Usage ### Quick Search Use the search script for simple queries: ```bash python ~/.openclaw/workspace/skills/tavily-search/scripts/tavily_search.py "your search query" ``` ### Python API ```python from scripts.tavily_search import tavily_search results = tavily_search("AI latest news", max_results=5) for result in results: print(f"Title: {result['title']}") print(f"URL: {result['url']}") print(f"Content: {result['content']}") ``` ### Advanced Options The search supports various parameters: - `max_results`: Number of results (default: 5) - `search_depth`: "basic" or "advanced" - `include_images`: Include image URLs - `include_answer`: Include AI-generated answer ## Output Format Tavily returns structured results with: - `query`: The search query - `answer`: AI-generated answer (if requested) - `results`: List of search results with title, url, content, score, and published_date