edit | blame | history | raw

---
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 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 using one of these methods:
  • .env file (推荐): 在 ~/.openclaw/.env 文件中配置:
    json {"env": {"TAVILY_API_KEY": "your_key_here"}}
  • Environment variable: export TAVILY_API_KEY=your_key_here
  • Direct parameter: Pass api_key when calling the function

Usage

Quick Search

Use the search script for simple queries:

python ~/.openclaw/workspace/skills/tavily-search/scripts/tavily_search.py "your search query"

Python API

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