tavily-dynamic-search

Pesquise na web, filtre resultados e extraia conteúdo para que dados brutos de pesquisa nunca entrem na sua janela de contexto. Apenas sua saída print() selecionada retorna.

npx skills add https://github.com/tavily-ai/skills --skill tavily-dynamic-search

Tavily Dynamic Search

Keep large raw web payloads on disk and return only the evidence needed for the task. This is useful when using --include-raw-content, combining several queries, or extracting multiple long pages. Do not use this workflow for a simple lookup that a normal tvly search --json can answer directly.

Before running

Search and extract support capped keyless access. Run them directly when tvly is available. If tvly is missing, follow the tavily-cli setup. Do not look for an API key or authenticate before the first request. If the keyless cap is reached in an interactive session, run tvly login to open browser OAuth, then retry the blocked request once. In an unattended environment, report the cap and authentication options instead of starting an interactive flow.

Workflow

  1. Search broadly without raw content and inspect titles, URLs, scores, and snippets.
  2. Fetch full content only for the best sources.
  3. When raw output could be large, save it with -o and filter the file before printing anything to the model context.
  4. Preserve source URLs beside every extracted fact.

When the user restricts evidence to official or named domains, validate the hostname of every selected URL during local filtering. --include-domains narrows the search but is not proof that every returned result belongs to an allowed host. If full-page extraction is unavailable, label conclusions as search-snippet evidence instead of implying that the page body was verified.

Keep the process in one turn when the relevant sources and filters are already known. Use another turn only when the first search changes what should be extracted.

Create a unique temporary task directory before saving evidence so concurrent agents do not overwrite one another. Python's tempfile.mkdtemp() is available when mktemp is not permitted. Reuse that directory for all raw and filtered artifacts from the task.

Small result: filter a direct JSON response

For a small search response, a pipe is enough:

tvly search "query" --max-results 5 --json | python3 -c '
import json, sys
data = json.load(sys.stdin)
for result in data.get("results", []):
    score = result.get("score") or 0
    title = result.get("title") or ""
    print(f"[{score:.2f}] {title}")
    print(result.get("url", ""))
    print(result.get("content", "")[:300])
'

Do not discard stderr. Authentication failures, keyless-cap messages, and API errors are actionable and must remain visible.

Large result: save first, then filter

Use the CLI's file output so raw page content does not pass through the tool response:

tvly search "query" \
  --include-raw-content markdown \
  --max-results 8 \
  --json \
  -o /tmp/tavily-search-results.json

Then print only bounded evidence:

python3 -c '
import json
from pathlib import Path

data = json.loads(Path("/tmp/tavily-search-results.json").read_text())
for result in data.get("results", []):
    title = result.get("title") or ""
    url = result.get("url") or ""
    print(f"## {title}")
    print(f"URL: {url}")
    print((result.get("raw_content") or result.get("content") or "")[:1200])
    print()
'

Adjust the filtering logic to the question. Prefer relevant paragraphs or fields over fixed character slices when the target information is known. Aim for roughly 150-600 tokens per source unless a table or code block genuinely requires more.

Targeted extraction

When search identifies the right URLs, extract only those pages:

tvly extract "https://example.com/article" \
  --json \
  -o /tmp/tavily-extract-results.json

For topic-focused pages, let Tavily reduce the response before local filtering:

tvly extract "https://example.com/docs" \
  --query "authentication API" \
  --chunks-per-source 3 \
  --json \
  -o /tmp/tavily-extract-results.json

Multiple queries

For multi-angle research, run a small set of focused searches, deduplicate by URL, and rank before extracting. Use subprocess.run(..., capture_output=True, text=True) when orchestrating commands in Python. Check returncode; if a command fails, surface its stderr and stop or retry deliberately. Never use a blanket except Exception: continue that hides missing evidence.

Response shapes

tvly search --json returns query, optional answer, results, and response_time. Each result commonly contains url, title, content, score, and optional raw_content.

tvly extract --json returns results, failed_results, and response_time. Each successful result commonly contains url, raw_content, and optional images.

Treat fields as optional and use .get() while filtering. Inspect failed_results instead of assuming every requested URL succeeded.

Useful options

OptionPurpose
--max-resultsBound the search result count; default 5, maximum 20
--depthChoose ultra-fast, fast, basic, or advanced
--time-rangeRestrict results to day, week, month, or year
--include-domainsRestrict results to a comma-separated list of trusted domains
--exclude-domainsExclude a comma-separated list of domains
--include-raw-contentInclude full content as markdown or text
-o, --outputSave the complete response to a file

Use jq only for short filters when Python is unavailable:

tvly search "query" --json | jq '[.results[] | {title, url, score, content}]'

Mais skills de tavily-ai

research
tavily-ai
Pesquisa abrangente sobre qualquer tópico com coleta automática de fontes, análise e citações. Realiza pesquisa web em múltiplas fontes com citações explícitas, ideal para comparações, eventos atuais, análise de mercado e relatórios detalhados. Oferece três opções de modelo: mini para pesquisa direcionada em tópico único (~30s), pro para análise abrangente multi-ângulo (~60-120s) e auto para detecção de complexidade orientada por API. Autentica via OAuth através do servidor MCP do Tavily com login automático baseado em navegador em...
search
tavily-ai
Pesquisa na web com resultados otimizados para LLM, pontuação de relevância e filtragem flexível. Suporta quatro modos de profundidade de pesquisa (ultra-rápido, rápido, básico, avançado) com latência configurável e compensações de relevância. Inclui filtragem por domínio, restrições de intervalo de tempo, intervalos de datas, priorização por país e extração de conteúdo bruto. Retorna resultados com título, URL, trecho de conteúdo e pontuação de relevância; resultados opcionais de imagem e favicons. Autenticação automática OAuth via servidor Tavily MCP ou configuração de chave de API;...
tavily-best-practices
tavily-ai
We need to translate the given text from English to Brazilian Portuguese. The text describes a web search API for LLMs with various methods. We must preserve product names, protocol names, URLs, numbers, technical terms. The name "tavily-best-practices" is not in the text, so we don't include it. We translate only the text inside <text>. No extra commentary, no labels. Let's translate: "Web search API for LLMs with real-time data access, content extraction, site crawling, and AI-powered research." -> "API de busca web para LLMs com acesso a dados em tempo real, extração de conteúdo, crawling de sites e pesquisa com IA." "Five core methods: search() for web results, extract() for URL content, crawl() for site-wide extraction, map() for URL discovery, and research() for end-to-end AI synthesis" -> "Cinco métodos principais: search() para resultados web, extract() para conteúdo de URL, crawl() para extração em todo o site, map() para descoberta de URLs e
tavily-cli
tavily-ai
Pesquisa na web, extração de conteúdo, rastreamento de sites e pesquisa aprofundada via Tavily CLI. Cinco modos de comando que abrangem pesquisa, extração, descoberta de URLs, rastreamento em massa e pesquisa com múltiplas fontes e citações. Todos os comandos suportam saída em JSON e salvamento em arquivo para fluxos de trabalho estruturados e agentivos. O padrão de escalonamento orienta você desde a pesquisa simples até extração, mapeamento, rastreamento e pesquisa abrangente, conforme suas necessidades. Requer instalação do tavily-cli e autenticação via chave de API com tvly login.
tavily-crawl
tavily-ai
Rastreador de sites com múltiplas páginas, filtragem semântica e exportação em markdown. Rastreie seções inteiras do site com controle de profundidade e largura; filtre por regex de caminho, domínio ou instruções em linguagem natural para focar os resultados. Salve cada página como arquivos markdown locais via --output-dir, ou retorne JSON estruturado para processamento agêntico. Use instruções semânticas com extração por chunks para evitar inchaço de contexto ao alimentar resultados para LLMs; use extração de página completa para downloads de documentação offline. Suporta...
tavily-extract
tavily-ai
Extrai markdown ou texto limpo de até 20 URLs, com suporte a renderização JavaScript e chunking focado em consultas. Lida com páginas renderizadas por JavaScript com profundidade de extração configurável (básica para páginas simples, avançada para SPAs dinâmicas e tabelas). Suporta extração focada em consulta para retornar apenas trechos de conteúdo relevantes, em vez de páginas inteiras. Retorna markdown otimizado para LLMs por padrão, com opções para formato de texto simples e saída JSON estruturada. Processa até 20 URLs em uma única chamada;...
tavily-research
tavily-ai
We need to translate the given text from English to Brazilian Portuguese. The text describes an AI-powered research tool. We must preserve the name "tavily-research" but it's not in the text, so ignore. Also preserve technical terms like "markdown", "JSON", "MLA", "APA", "Chicago", "async", "poll", etc. No extra commentary. Just translate the text inside <text>. The text: "Comprehensive AI-powered research with multi-source synthesis and citations. Produces structured reports grounded in web sources, taking 30-120 seconds depending on model selection (mini for targeted queries, pro for complex comparisons) Supports multiple output formats: markdown reports, JSON with custom schemas, and configurable citation styles (numbered, MLA, APA, Chicago) Includes async workflow for long-running research via --no-wait , status , and poll commands, plus real-time..." Translation: "Pesquisa abrangente com inteligência artificial, síntese de múltiplas fontes e citações. Produz relatórios estruturados base
tavily-search
tavily-ai
Pesquisa na web com resultados otimizados para LLM, trechos de conteúdo e pontuações de relevância. Suporta quatro profundidades de pesquisa (ultra-rápida, rápida, básica, avançada) com contagens de resultados configuráveis de até 20, além de filtragem por domínio e restrições de intervalo de tempo. Retorna saída JSON estruturada com trechos de conteúdo, pontuações de relevância e metadados otimizados para consumo por LLM. Inclui modos de pesquisa especializados para tópicos de notícias e finanças, com respostas geradas por IA opcionais e extração de conteúdo completo de páginas. Integra-se a...