tavily-ai/tavily-mejores-prácticas

Crea integraciones Tavily listas para producción con las mejores prácticas incorporadas. Documentación de referencia para desarrolladores que utilizan asistentes de codificación (Claude Code, Cursor, etc.) para implementar búsqueda web, extracción de contenido, rastreo e investigación en flujos de trabajo agentivos, sistemas RAG o agentes autónomos.

¿Qué es tavily-mejores-prácticas?

Este skill proporciona una guía completa y basada en las mejores prácticas para integrar la API de Tavily en aplicaciones de inteligencia artificial, especialmente diseñado para desarrolladores que trabajan con asistentes de codificación como Claude Code, Cursor y otros. Su objetivo principal es facilitar la implementación de búsqueda web en tiempo real, extracción de contenido, rastreo profundo de sitios y tareas de investigación complejas, todo dentro de flujos de trabajo agentivos o sistemas de Generación Aumentada por Recuperación (RAG). El skill detalla cómo configurar correctamente las consultas, manejar la autenticación, procesar los resultados (incluyendo el uso de resúmenes, extracción de metadatos y fragmentos relevantes), y optimizar el rendimiento con el caché y las opciones de profundidad de búsqueda. Además, incluye ejemplos de código en Python y Node.js, así como patrones para construir agentes autónomos que puedan navegar por la web de manera inteligente, siguiendo enlaces y extrayendo información estructurada de forma fiable. Está diseñado para desarrolladores que buscan una integración robusta y eficiente de Tavily en sus pipelines de IA, evitando errores comunes y siguiendo las convenciones recomendadas por el equipo de Tavily.

Compatible con✓Claude Code~Codex CLI✓Cursor✓Antigravity
npx skills add https://github.com/tavily-ai/skills/tree/main/skills/tavily-best-practices

Installed? Explore more Investigación y análisis de datos skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

¿Qué hace tavily-mejores-prácticas?

Crea integraciones Tavily listas para producción con las mejores prácticas incorporadas. Documentación de referencia para desarrolladores que utilizan asistentes de codificación (Claude Code, Cursor, etc.) para implementar búsqueda web, extracción de contenido, rastreo e investigación en flujos de trabajo agentivos, sistemas RAG o agentes autónomos.

Introducción

Esta guía asume que ya tienes una clave de API de Tavily (TAVILY_API_KEY). Si no es así, regístrate en Tavily.

Configuración inicial

Instala el paquete de Tavily:

pip install tavily-python

o para Node.js:

npm install @tavily/core

Configura tu clave de API como variable de entorno:

export TAVILY_API_KEY="tvly-tu-clave-aqui"

Mejores prácticas clave

1. Usa siempre el parámetro search_depth

Para obtener resultados más precisos y relevantes, establece search_depth en "advanced" cuando necesites información detallada. Para consultas simples y rápidas, usa "basic".

from tavily import TavilyClient

client = TavilyClient(api_key="tvly-tu-clave-aqui")
response = client.search(query="últimas noticias de IA", search_depth="advanced")
print(response)

2. Aprovecha la extracción de contenido

Para tareas de investigación profundas, usa la función extract para obtener el contenido completo de una página web.

urls = ["https://example.com/articulo", "https://example.org/otro-articulo"]
extracted_content = client.extract(urls=urls)
for result in extracted_content["results"]:
    print(f"Título: {result['title']}")
    print(f"Contenido: {result['content'][:500]}...")

3. Usa el caché de manera inteligente

Tavily proporciona un caché incorporado. Reutiliza los resultados de búsqueda para consultas idénticas dentro de un período de tiempo corto para evitar costos innecesarios.

# La primera llamada realizará una búsqueda real
resultado1 = client.search(query="eventos de IA 2024")

# La segunda llamada para la misma consulta usará el caché si está disponible
resultado2 = client.search(query="eventos de IA 2024", use_cache=True)

4. Filtra por dominios

Si tu agente necesita información de fuentes confiables, especifica los dominios permitidos en el parámetro include_domains.

response = client.search(
    query="regulación de IA en Europa",
    include_domains=["europa.eu", "gov.uk"]
)

5. Integración con agentes autónomos

Para construir un agente que navegue por la web de manera autónoma, combina search y extract en un ciclo.

def agentic_research(query):
    # Paso 1: Buscar páginas relevantes
    search_results = client.search(query, search_depth="advanced")
    urls = [result["url"] for result in search_results["results"][:3]]
    
    # Paso 2: Extraer contenido detallado
    if urls:
        full_content = client.extract(urls=urls)
        for item in full_content["results"]:
            print(f"Extrayendo: {item['url']}")
            print(f"Contenido: {item['content'][:1000]}...")
    return full_content

resultado_investigacion = agentic_research("últimos avances en modelos de lenguaje")

Conclusión

Siguiendo estas mejores prácticas, puedes construir integraciones Tavily robustas y eficientes que aprovechen al máximo la búsqueda web en tiempo real, la extracción de contenido y el rastreo para tus flujos de trabajo de IA. Para más detalles, consulta la documentación oficial de Tavily.

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

tavily-ai/crawl

Crawl any website and save pages as local markdown files. Use when you need to download documentation, knowledge bases, or web content for offline access or analysis. No code required - just provide a URL.

tavily-ai/extract

Extract content from specific URLs using Tavily's extraction API. Returns clean markdown/text from web pages. Use when you have specific URLs and need their content without writing code.

tavily-ai/research

Comprehensive research grounded in web data with explicit citations. Use when you need multi-source synthesis—comparisons, current events, market analysis, detailed reports.

tavily-ai/search

Search the web using Tavily's LLM-optimized search API. Returns relevant results with content snippets, scores, and metadata. Use when you need to find web content on any topic without writing code.

tavily-ai/tavily-cli

Web search, content extraction, crawling, and deep research via the Tavily CLI. Use this skill whenever the user wants to search the web, find articles, research a topic, look something up online, extract content from a URL, grab text from a webpage, crawl documentation, download a site's pages, discover URLs on a domain, or conduct in-depth research with citations. Also use when they say "fetch this page", "pull the content from", "get the page at https://", "find me articles about", or reference extracting data from external websites. This provides LLM-optimized web search, content extraction, site crawling, URL discovery, and AI-powered deep research — capabilities beyond what agents can do natively. Do NOT trigger for local file operations, git commands, deployments, or code editing tasks.

tavily-ai/tavily-crawl

Crawl websites and extract content from multiple pages via the Tavily CLI. Use this skill when the user wants to crawl a site, download documentation, extract an entire docs section, bulk-extract pages, save a site as local markdown files, or says "crawl", "get all the pages", "download the docs", "extract everything under /docs", "bulk extract", or needs content from many pages on the same domain. Supports depth/breadth control, path filtering, semantic instructions, and saving each page as a local markdown file.

tavily-ai/tavily-dynamic-search

Programmatic web search with context isolation. Use this skill for any research task where you need to search the web, filter results, and extract specific information — without polluting your context window with raw HTML and boilerplate. This is the default skill for web research. Triggered by "search for", "look up", "find", "research", "what's the latest on", or any query that requires current web information. Also use when asked to "search and filter", "find the important parts", or "extract the key details" — any case where the user wants curated, noise-free content.

tavily-ai/tavily-extract

Extract clean markdown or text content from specific URLs via the Tavily CLI. Use this skill when the user has one or more URLs and wants their content, says "extract", "grab the content from", "pull the text from", "get the page at", "read this webpage", or needs clean text from web pages. Handles JavaScript-rendered pages, returns LLM-optimized markdown, and supports query-focused chunking for targeted extraction. Can process up to 20 URLs in a single call.

tavily-ai/tavily-map

Discover and list all URLs on a website without extracting content, via the Tavily CLI. Use this skill when the user wants to find a specific page on a large site, list all URLs, see the site structure, find where something is on a domain, or says "map the site", "find the URL for", "what pages are on", "list all pages", or "site structure". Faster than crawling — returns URLs only. Essential when you know the site but not the exact page. Combine with extract for targeted content retrieval.

tavily-ai/tavily-research

Conduct comprehensive AI-powered research with citations via the Tavily CLI. Use this skill when the user wants deep research, a detailed report, a comparison, market analysis, literature review, or says "research", "investigate", "analyze in depth", "compare X vs Y", "what does the market look like for", or needs multi-source synthesis with explicit citations. Returns a structured report grounded in web sources. Takes 30-120 seconds. For quick fact-finding, use tavily-search instead.

tavily-ai/tavily-search

Search the web with LLM-optimized results via the Tavily CLI. Use this skill when the user wants to search the web, find articles, look up information, get recent news, discover sources, or says "search for", "find me", "look up", "what's the latest on", "find articles about", or needs current information from the internet. Returns relevant results with content snippets, relevance scores, and metadata — optimized for LLM consumption. Supports domain filtering, time ranges, and multiple search depths.

Skills relacionados