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:
- - choose the right query
- choose the right profile
- keep the first pass small
- escalate only when the first pass is insufficient
Core Idea
Prefer evidence-first retrieval over answer-first retrieval.
Default pattern:
- 1. Run a small Tavily search with an intent-aligned profile.
- Inspect titles, URLs, domains, snippets, dates, and scores.
- Rewrite the query or refine Tavily parameters if the first pass is weak.
- Extract content from the best 1–3 URLs only when more detail is needed.
- 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:
- - environment variable: INLINECODE0
- INLINECODE1 containing INLINECODE2
The skill metadata only requires python3, because the script can load the API key from either location.
Quick Start
CODEBLOCK0
Working Principles
- - Keep search queries compact, entity-heavy, and task-specific.
- Keep the first pass small: usually
max_results=3..5. - Prefer explicit parameters over broad, vague prompting.
- Use Tavily-native knobs to match intent instead of stuffing instructions into the query.
- Default to
--include-answer off and let downstream reasoning synthesize the answer. - Default to
--include-raw-content off on the first pass. - Prefer
search -> extract over search + huge raw content. - Use
--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:
- - INLINECODE11
- INLINECODE12
- INLINECODE13
- INLINECODE14
- INLINECODE15
news
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:
- - INLINECODE17
- add
time_range or start_date/end_date when the time window matters - start with INLINECODE20
finance
Use for company, market, filings, earnings, and finance-specific information.
Default shape:
- - INLINECODE22
- start with INLINECODE23
- add
time_range or domain filters if needed
official
Use when the user implicitly wants official docs, vendor docs, standards, API references, or primary sources.
Default shape:
- - INLINECODE26
- use INLINECODE27
- keep
max_results small - escalate to
advanced only if the first pass is noisy
precision
Use when exact wording, a specific page, or a narrow entity match matters.
Default shape:
- - use quoted strings when appropriate
- consider INLINECODE31
- use INLINECODE32
- set INLINECODE33
regional
Use when the source region matters more than the global web average.
Default shape:
- - add INLINECODE35
- combine with
general, news, or finance intent as needed
Query Planning
Plan the query at the semantic level, then let Tavily do the retrieval work.
Good first-pass queries usually have these properties:
- - one main information goal
- the main entities named explicitly
- little or no conversational filler
- no unnecessary formatting instructions
- optional date or source constraints only when they help retrieval
Prefer:
- - INLINECODE39
- INLINECODE40
- INLINECODE41
Avoid:
- - long essay prompts
- combining many unrelated asks in one query
- asking Tavily to already write the final answer inside the query
For detailed rewrite patterns, read:
Command Surface
The implementation lives at:
Search
CODEBLOCK1
Main flags:
- - INLINECODE44
- INLINECODE45
- INLINECODE46
- INLINECODE47
- INLINECODE48 or exact INLINECODE49
- INLINECODE50
- INLINECODE51
- INLINECODE52
- INLINECODE53
- INLINECODE54
- INLINECODE55
- INLINECODE56
- INLINECODE57
- INLINECODE58
- INLINECODE59
- INLINECODE60
Extract
CODEBLOCK2
Main flags:
- -
--query ... for reranking extracted chunks - INLINECODE62
- INLINECODE63
- INLINECODE64
- INLINECODE65
- INLINECODE66
- INLINECODE67
- INLINECODE68
Map
CODEBLOCK3
Main flags:
- - INLINECODE69
- INLINECODE70
- INLINECODE71
- INLINECODE72
- INLINECODE73
- INLINECODE74
- INLINECODE75
- INLINECODE76
- INLINECODE77 /
--no-allow-external (default is to exclude external links) - INLINECODE79
- INLINECODE80
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-aligned
search 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:
- - INLINECODE83
- INLINECODE84 or INLINECODE85
- INLINECODE86 / INLINECODE87
- INLINECODE88
- INLINECODE89
- INLINECODE90
- INLINECODE91
Step 4 — Extract top URLs
When snippets are promising but insufficient, run
extract 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:
Output Philosophy
Expose a stable shape to the model while preserving Tavily signals that help planning.
Preferred default output is agent, which preserves:
- - the original query
- the executed query and parameters
- the selected profile
- source domain
- score when available
- snippet or extracted content chunks
- usage metadata when available
- response time and request identifiers when available
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:
- - INLINECODE99
- INLINECODE100
When Not to Use This Skill
Do not use this skill when:
- - the answer is fully contained in local files or already-open documents
- the task is pure writing or transformation with no need for external sources
- a specialized tool already exists for the target system
- the task is a large, asynchronous research workflow better handled by Tavily Research or another research-specific workflow
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.
更好的Tavily搜索
当任务需要新鲜的外部证据、链接、当前事实、官方文档或来源发现时,请使用Tavily。
此技能并非僵化的搜索策略。
模型仍应进行规划。
使用Tavily的控制功能更精确地表达该规划:
- - 选择合适的查询
- 选择合适的配置文件
- 保持首次搜索范围较小
- 仅在首次搜索不足时升级
核心理念
优先采用证据优先检索而非答案优先检索。
默认模式:
- 1. 使用与意图匹配的配置文件运行小型Tavily搜索。
- 检查标题、URL、域名、摘要、日期和评分。
- 如果首次搜索效果不佳,重写查询或优化Tavily参数。
- 仅在需要更多细节时,从最佳1-3个URL中提取内容。
- 仅对文档或站点导航任务使用站点映射。
除非任务明确需要,否则不要从大量原始内容负载开始。
要求
认证由脚本本身加载。
以下任一方式均有效:
- - 环境变量:TAVILYAPIKEY
- ~/.openclaw/.env 包含 TAVILYAPIKEY=...
技能元数据仅需要 python3,因为脚本可以从任一位置加载API密钥。
快速开始
bash
通用搜索
python3 {baseDir}/scripts/tavily.py search \
--query OpenClaw技能文档 \
--profile general \
--max-results 5 \
--format agent
最新新闻搜索
python3 {baseDir}/scripts/tavily.py search \
--query 美联储2026年3月会议 \
--profile news \
--time-range month \
--max-results 5 \
--format agent
官方域名搜索
python3 {baseDir}/scripts/tavily.py search \
--query Python asyncio任务组文档 \
--profile official \
--include-domains docs.python.org \
--max-results 5 \
--format agent
高精度搜索
python3 {baseDir}/scripts/tavily.py search \
--query 精确短语 OpenClaw \
--profile precision \
--search-depth advanced \
--chunks-per-source 3 \
--max-results 5 \
--format agent
从顶部URL提取内容
python3 {baseDir}/scripts/tavily.py extract \
--query OpenClaw技能前置元数据要求 \
--urls https://docs.openclaw.ai/tools/skills,https://docs.openclaw.ai/tools/creating-skills \
--chunks-per-source 3 \
--format md
提取前映射文档站点
python3 {baseDir}/scripts/tavily.py map \
--url https://docs.openclaw.ai \
--format raw
工作原则
- - 保持搜索查询简洁、实体密集且任务特定。
- 保持首次搜索范围较小:通常 max_results=3..5。
- 优先使用明确参数而非宽泛模糊的提示。
- 使用Tavily原生旋钮匹配意图,而非将指令塞入查询。
- 默认关闭 --include-answer,让下游推理综合答案。
- 首次搜索默认关闭 --include-raw-content。
- 优先采用 search -> extract 而非 search + 大量原始内容。
- 仅作为恢复步骤或意图确实模糊时使用 --auto-parameters。
意图配置文件
以配置文件而非扁平的低级标志列表进行思考。
选择与任务匹配的最小配置文件。
general
用于普通网页搜索、概念查询、背景验证和广泛来源发现。
默认形态:
- - topic=general
- searchdepth=basic
- maxresults=3..5
- includeanswer=false
- includeraw_content=false
news
当用户询问近期事件、近期政策变化、体育、政治或任何以最新、近期、今天或本周为框架的内容时使用。
默认形态:
- - topic=news
- 当时间窗口重要时添加 timerange 或 startdate/enddate
- 从 searchdepth=basic 开始
finance
用于公司、市场、文件、收益和金融特定信息。
默认形态:
- - topic=finance
- 从 basic 开始
- 必要时添加 time_range 或域名过滤器
official
当用户隐含需要官方文档、供应商文档、标准、API参考或主要来源时使用。
默认形态:
- - topic=general
- 使用 includedomains
- 保持 maxresults 较小
- 仅当首次搜索噪音大时升级到 advanced
precision
当精确措辞、特定页面或窄实体匹配重要时使用。
默认形态:
- - 适当时使用引号字符串
- 考虑 exactmatch=true
- 使用 searchdepth=advanced
- 设置 chunkspersource=2..3
regional
当来源区域比全球网络平均值更重要时使用。
默认形态:
- - 添加 country
- 根据需要与 general、news 或 finance 意图结合
查询规划
在语义层面规划查询,然后让Tavily执行检索工作。
良好的首次查询通常具有以下属性:
- - 一个主要信息目标
- 明确命名主要实体
- 很少或没有对话填充词
- 没有不必要的格式化指令
- 仅在有助于检索时添加日期或来源约束
优先选择:
- - OpenClaw skills documentation site:docs.openclaw.ai
- SEC 10-K NVIDIA fiscal 2026
- Boston University data science tuition 2026 official
避免:
- - 长篇论文式提示
- 在一个查询中组合多个不相关的请求
- 要求Tavily在查询中已写出最终答案
有关详细的重写模式,请阅读:
- - references/query_playbook.md
命令界面
实现位于:
搜索
bash
python3 {baseDir}/scripts/tavily.py search --query ...
主要标志:
- - --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} 或精确 --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}
提取
bash
python3 {baseDir}/scripts/tavily.py extract --urls https://...
主要标志:
- - --query ... 用于对提取的块进行重新排序
- --chunks-per-source N
- --extract-depth {basic,advanced}
- --content-format {markdown,text}
- --include-images
- --include-favicon
- --request-timeout SECONDS
- --format {agent,raw,md}
映射
bash
python3 {baseDir}/scripts/tavily.py map --url https://...
主要标志:
- - --instructions ...
- --max-depth N
- --max-breadth N
- --limit N
- --select-paths ...
- --select-domains ...
- --exclude-paths ...
- --exclude-domains ...
- --allow-external / --no-allow-external(默认排除外部链接)
- --request-timeout SECONDS
- --format {agent,raw,md}
有关精确标志行为,请在相关子命令上运行 --help。
升级阶梯
使用能够解决问题的最轻量步骤。
步骤1 — 小型搜索
从与配置文件对齐的 search 调用开始。
步骤2 — 重写查询
如果结果宽泛、过时或噪音大,在扩展结果数量前重写查询。
步骤3 — 优化参数
使用以下一个或多个:
- - topic
- timerange 或 startdate/enddate
- includedomains / excludedomains
- country
- exactmatch
- searchdepth=fast|advanced
- chunksper_source
步骤4 — 提取顶部URL
当摘要看起来有希望但不足时,对最佳1-3个URL运行 extract。
将相同的用户意图作为 query 传递,以便Tavily可以对提取的块进行