Better Tavily Search
by @soymilkwinsagain
The best skill to retrieve fresh web evidence with Tavily. Use for source finding, link discovery, official documentation lookup, current-event verification,...
clawhub install better-tavily-searchπ About This Skill
name: better-tavily-search description: The best skill to retrieve fresh web evidence with Tavily. Use for source finding, link discovery, official documentation lookup, current-event verification, and other tasks that need external web retrieval. Let the model plan the search, then express that plan with Tavily-native controls and a small-result, evidence-first workflow. homepage: https://docs.tavily.com/documentation/api-reference/endpoint/search metadata: openclaw: emoji: "π" requires: bins: ["python3"] primaryEnv: "TAVILY_API_KEY"
Better Tavily Search
Use Tavily when the task needs fresh external evidence, links, current facts, official documentation, or source discovery.
This skill is not a rigid search policy. The model should still plan. Use Tavily's controls to express that plan more precisely:
Core Idea
Prefer evidence-first retrieval over answer-first retrieval.
Default pattern: 1. Run a small Tavily search with an intent-aligned profile. 2. Inspect titles, URLs, domains, snippets, dates, and scores. 3. Rewrite the query or refine Tavily parameters if the first pass is weak. 4. Extract content from the best 1β3 URLs only when more detail is needed. 5. Use site mapping only for documentation or site-navigation tasks.
Do not start with large raw-content payloads unless the task clearly requires them.
Requirements
Authentication is loaded by the script itself. Either of these is valid:
TAVILY_API_KEY~/.openclaw/.env containing TAVILY_API_KEY=...The skill metadata only requires python3, because the script can load the API key from either location.
Quick Start
# general search
python3 {baseDir}/scripts/tavily.py search \
--query "OpenClaw skills documentation" \
--profile general \
--max-results 5 \
--format agentrecent news search
python3 {baseDir}/scripts/tavily.py search \
--query "Federal Reserve meeting March 2026" \
--profile news \
--time-range month \
--max-results 5 \
--format agentofficial-domain search
python3 {baseDir}/scripts/tavily.py search \
--query "Python asyncio task group docs" \
--profile official \
--include-domains docs.python.org \
--max-results 5 \
--format agenthigher-precision search
python3 {baseDir}/scripts/tavily.py search \
--query '"exact phrase" OpenClaw' \
--profile precision \
--search-depth advanced \
--chunks-per-source 3 \
--max-results 5 \
--format agentextract content from top URLs
python3 {baseDir}/scripts/tavily.py extract \
--query "OpenClaw skills frontmatter requirements" \
--urls "https://docs.openclaw.ai/tools/skills,https://docs.openclaw.ai/tools/creating-skills" \
--chunks-per-source 3 \
--format mdmap a documentation site before extraction
python3 {baseDir}/scripts/tavily.py map \
--url "https://docs.openclaw.ai" \
--format raw
Working Principles
max_results=3..5.--include-answer off and let downstream reasoning synthesize the answer.--include-raw-content off on the first pass.search -> extract over search + huge raw content.--auto-parameters only as a recovery step or when the intent is genuinely ambiguous.Intent Profiles
Think in profiles, not in a flat list of low-level flags. Choose the smallest profile that matches the task.
general
Use for ordinary web search, concept lookup, background verification, and broad source finding.Default shape:
topic=generalsearch_depth=basicmax_results=3..5include_answer=falseinclude_raw_content=falsenews
Use when the user asks about recent events, recent policy changes, sports, politics, or anything framed as latest, recent, today, or this week.Default shape:
topic=newstime_range or start_date/end_date when the time window matterssearch_depth=basicfinance
Use for company, market, filings, earnings, and finance-specific information.Default shape:
topic=financebasictime_range or domain filters if neededofficial
Use when the user implicitly wants official docs, vendor docs, standards, API references, or primary sources.Default shape:
topic=generalinclude_domainsmax_results smalladvanced only if the first pass is noisyprecision
Use when exact wording, a specific page, or a narrow entity match matters.Default shape:
exact_match=truesearch_depth=advancedchunks_per_source=2..3regional
Use when the source region matters more than the global web average.Default shape:
countrygeneral, news, or finance intent as neededQuery Planning
Plan the query at the semantic level, then let Tavily do the retrieval work.
Good first-pass queries usually have these properties:
Prefer:
OpenClaw skills documentation site:docs.openclaw.aiSEC 10-K NVIDIA fiscal 2026Boston University data science tuition 2026 officialAvoid:
For detailed rewrite patterns, read:
references/query_playbook.mdCommand Surface
The implementation lives at:
scripts/tavily.pySearch
python3 {baseDir}/scripts/tavily.py search --query "..."
Main flags:
--profile {general,news,finance,official,precision,regional}--topic {general,news,finance}--search-depth {ultra-fast,fast,basic,advanced}--max-results N--time-range {day,week,month,year} or exact --start-date YYYY-MM-DD --end-date YYYY-MM-DD--include-domains ...--exclude-domains ...--country ...--exact-match--auto-parameters--chunks-per-source N--include-answer [basic|advanced]--include-raw-content [markdown|text]--include-favicon--safe-search--format {agent,raw,md,brave}Extract
python3 {baseDir}/scripts/tavily.py extract --urls "https://..."
Main flags:
--query ... for reranking extracted chunks--chunks-per-source N--extract-depth {basic,advanced}--content-format {markdown,text}--include-images--include-favicon--request-timeout SECONDS--format {agent,raw,md}Map
python3 {baseDir}/scripts/tavily.py map --url "https://..."
Main flags:
--instructions ...--max-depth N--max-breadth N--limit N--select-paths ...--select-domains ...--exclude-paths ...--exclude-domains ...--allow-external / --no-allow-external (default is to exclude external links)--request-timeout SECONDS--format {agent,raw,md}For exact flag behavior, run --help on the relevant subcommand.
Escalation Ladder
Use the lightest step that can solve the task.
Step 1 β Small search
Start with a profile-alignedsearch call.Step 2 β Rewrite the query
If results are broad, stale, or noisy, rewrite the query before expanding result count.Step 3 β Refine parameters
Use one or more of:topictime_range or start_date/end_dateinclude_domains / exclude_domainscountryexact_matchsearch_depth=fast|advancedchunks_per_sourceStep 4 β Extract top URLs
When snippets are promising but insufficient, runextract on the best 1β3 URLs.
Pass the same user intent as query so Tavily can rerank extracted chunks.Step 5 β Map then extract
When the task is really about navigating a documentation site or knowledge base, map the site first, then extract selected pages.Step 6 β Stop escalating
If the top sources already answer the question, stop. Do not keep searching just because more knobs exist.For the detailed decision tree, read:
references/escalation_rules.mdOutput Philosophy
Expose a stable shape to the model while preserving Tavily signals that help planning.
Preferred default output is agent, which preserves:
Use raw when you need the closest representation of Tavily's response.
Use md for human inspection.
Use brave only when a downstream consumer expects a Brave-like result shape.
For the detailed schema, read:
references/output_contract.mdreferences/param_matrix.mdWhen Not to Use This Skill
Do not use this skill when:
Notes for the Implementer
This wrapper should reflect Tavily's design, not fight it. Expose the parameters that matter for model planning, but still protect context size and credit usage with conservative defaults and stable output contracts.
π‘ Examples
# general search
python3 {baseDir}/scripts/tavily.py search \
--query "OpenClaw skills documentation" \
--profile general \
--max-results 5 \
--format agentrecent news search
python3 {baseDir}/scripts/tavily.py search \
--query "Federal Reserve meeting March 2026" \
--profile news \
--time-range month \
--max-results 5 \
--format agentofficial-domain search
python3 {baseDir}/scripts/tavily.py search \
--query "Python asyncio task group docs" \
--profile official \
--include-domains docs.python.org \
--max-results 5 \
--format agenthigher-precision search
python3 {baseDir}/scripts/tavily.py search \
--query '"exact phrase" OpenClaw' \
--profile precision \
--search-depth advanced \
--chunks-per-source 3 \
--max-results 5 \
--format agentextract content from top URLs
python3 {baseDir}/scripts/tavily.py extract \
--query "OpenClaw skills frontmatter requirements" \
--urls "https://docs.openclaw.ai/tools/skills,https://docs.openclaw.ai/tools/creating-skills" \
--chunks-per-source 3 \
--format mdmap a documentation site before extraction
python3 {baseDir}/scripts/tavily.py map \
--url "https://docs.openclaw.ai" \
--format raw