tavily-search
Use Tavily Search API for optimized, real-time web search results for RAG. Requires TAVILY_API_KEY.
When & Why to Use This Skill
This Claude skill integrates the Tavily Search API to deliver optimized, real-time web search results specifically tailored for Retrieval-Augmented Generation (RAG) and LLM workflows. It solves the challenge of AI hallucinations by providing clean, noise-free, and up-to-date information, ensuring that AI agents have access to the most current web data for grounded and accurate response generation.
Use Cases
- Real-time Fact Checking: Enabling AI agents to verify claims or fetch the latest news and events that occurred after the model's knowledge cutoff.
- RAG Pipeline Enhancement: Providing high-quality, pre-filtered context for Retrieval-Augmented Generation systems to improve the precision of complex queries.
- Deep Market Research: Utilizing the 'advanced' search depth to perform comprehensive competitive analysis and gather detailed industry insights from multiple sources.
- Technical Troubleshooting: Searching for specific error codes, latest API documentation, or community-driven solutions across the web to assist in debugging.
| name | tavily-search |
|---|---|
| description | Use Tavily Search API for optimized, real-time web search results for RAG. Requires TAVILY_API_KEY. |
Tavily Search Skill
This skill utilizes the Tavily Search API, providing clean, real-time web search results optimized for LLMs and RAG pipelines.
Setup
Dependencies: Requires
tavily-python.pip install tavily-python python-dotenvAPI Key Configuration: Requires
TAVILY_API_KEY.# If the script fails due to a missing key, run the following: echo "It seems the Tavily API key is not set up." read -p "Enter your Tavily API key: " TAVILY_KEY echo "TAVILY_API_KEY=$TAVILY_KEY" >> .env if [ -f .gitignore ] && ! grep -q ".env" .gitignore; then echo ".env" >> .gitignore; fi echo "API key saved to .env."
Usage
Use the scripts/tavily_search.py script.
Command
python3 scripts/tavily_search.py --query "<query>" [--max-results <N>] [--search-depth <basic|advanced>]
Parameters
--query(Required): The search query.--search-depth(Optional): Defaultbasic. Useadvancedfor intensive research (higher quality, slower).--max-results(Optional): Default 10.
Example
python3 scripts/tavily_search.py --query "autonomous research agents comparison" --search-depth advanced
Output
The script outputs JSON containing a synthesized answer (if requested by the script) and a list of results (URL, title, content snippets).