skillfed

tavily-best-practices

Learn to build production Tavily integrations with patterns for web search, URL content extraction, site crawling, and AI-synthesized research. Covers SDK setup, method selection, async patterns, and framework integrations for agents and RAG systems.

Tavily Best Practices helps you integrate Tavily's search API into LLM agents for real-time web access and research workflows.

AI-generated summary based on this skill's SKILL.md

13,862 1,205 MIT updated by andrewyng

Install

andrewyng/context-hub/tavily-best-practices · repository language: JavaScript

CLI (skillfed)coming soon
git clone https://github.com/andrewyng/context-hub
cp -r context-hub/content/tavily/skills/tavily-best-practices ~/.claude/skills/tavily-best-practices

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I use Tavily search API for AI agents?

tavily-best-practices teaches you to integrate Tavily's search API into LLM agents for real-time web access. Start by setting up your API key as an environment variable, then use the Python SDK to instantiate a Tavily client. For agents, wrap Tavily search calls as tool functions that your LLM can invoke. The skill covers patterns for passing user queries to Tavily, handling search results, and feeding them back into your agent's context for decision-making.

What's the difference between tavily crawl vs extract?

tavily-best-practices explains that Tavily's extract method retrieves content from specific URLs you provide, ideal for RAG systems needing precise document content. Crawl discovers and processes multiple pages within a domain, useful for comprehensive site indexing. Extract is faster for targeted content; crawl is better for building knowledge bases from entire websites. Choose based on whether you need specific URLs (extract) or broad site coverage (crawl).

How do I set up tavily-best-practices for LangChain or LlamaIndex?

tavily-best-practices includes framework integration examples for both LangChain and LlamaIndex. For LangChain, create a tool wrapper around Tavily's search or extract methods and add it to your agent's toolkit. LlamaIndex users can use Tavily as a data loader or query engine component. Both frameworks benefit from async patterns covered in the skill—use Tavily's async client for parallel queries to avoid blocking your agent workflow.

What are best practices for production Tavily implementations?

tavily-best-practices covers production patterns including API key management via environment variables, async client usage for parallel queries, appropriate search depth selection (basic vs advanced), and semantic instruction tuning for better results. Key practices: cache results when possible, set max_results to balance cost and quality, use domain filtering to narrow scope, and monitor query performance. Test extraction depth settings before scaling.

How do I optimize search queries and extraction depth for efficiency?

tavily-best-practices teaches query optimization by adjusting the max_results parameter—fewer results reduce latency and cost. Search depth (basic vs advanced) trades speed for comprehensiveness; use basic for quick lookups, advanced for research. Semantic instructions guide Tavily toward relevant content, reducing noise. For multi-URL extraction, leverage async patterns to parallelize requests. Monitor token usage and adjust depth based on your agent's context window limits.

Can tavily-best-practices help with automated competitive analysis?

Yes. tavily-best-practices covers AI-powered research synthesis using Tavily for competitive analysis. Use the search API to gather competitor data, then extract detailed content from their sites. Combine results with LLM synthesis to generate insights. The skill shows how to structure semantic instructions for domain-specific queries, filter by site, and parallelize crawls across multiple competitors. This pattern scales for ongoing market monitoring.

SKILL.md

rendered from the published skill — quoted content, verbatim

Tavily

Tavily is a search API designed for LLMs, enabling AI applications to access real-time web data.

Installation

Python:

pip install tavily-python

JavaScript:

npm install @tavily/core

See references/sdk.md for complete SDK reference.

Client Initialization

from tavily import TavilyClient

# Uses TAVILY_API_KEY env var (recommended)
client = TavilyClient()

#With project tracking (for usage organization)
client = TavilyClient(project_id="your-project-id")

# Async client for parallel queries
from tavily import AsyncTavilyClient
async_client = AsyncTavilyClient()

Choosing the Right Method

For custom agents/workflows:

Need Method
Web search results search()

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 7 files
content/tavily/skills/tavily-best-practices/SKILL.md
content/tavily/skills/tavily-best-practices/references/crawl.md
content/tavily/skills/tavily-best-practices/references/extract.md
content/tavily/skills/tavily-best-practices/references/integrations.md
content/tavily/skills/tavily-best-practices/references/research.md
content/tavily/skills/tavily-best-practices/references/sdk.md
content/tavily/skills/tavily-best-practices/references/search.md

Related skills

Tags

llm-search-integration real-time-web-data agentic-workflows content-extraction-api semantic-crawling rag-data-retrieval ai-research-synthesis web-scraping-framework async-search-patterns structured-data-extraction