tavily-web-seeker
Enhanced web search skill built on Tavily API with intelligent search strategies, user source preferences, and critical source handling.
Features
- 1. Intent Recognition - Auto-classify queries (factual, news, research, comparison, how-to, academic)
- Source Preferences - Topic-based domain routing (tech→GitHub, news→Reuters, finance→WSJ)
- Search Operators - Support OR, site:, -, exact phrase, time filters
- Critical Source Check - Validate results against preferred sources, return not-found conclusions
- Multi-API Key Rotation - Auto-failover on rate limits (429)
- Offline Report - Markdown export with source coverage analysis
Tools
| Tool | Description |
|---|
| INLINECODE0 | Standard Tavily search |
| INLINECODE1 |
Enhanced search with all features |
Configuration
API Keys
CODEBLOCK0
Or env: TAVILY_API_KEY, INLINECODE3
Source Preferences
CODEBLOCK1
web_seeker Parameters
| Parameter | Type | Default | Description |
|---|
| INLINECODE4 | string | - | Search query |
| INLINECODE5 |
string | "quick" | quick/research/compare |
|
max_results | number | 5 | Results 1-20 |
|
domains | array | auto | Preferred domains |
|
time_range | string | auto | day/week/month/year |
|
operators | string | - | Raw operators |
|
strict_mode | boolean | false | Require preferred sources only |
|
export_doc | boolean | false | Generate report |
Response Format
CODEBLOCK2
Not Found Response
CODEBLOCK3
Usage
CODEBLOCK4
tavily-web-seeker
基于Tavily API构建的增强型网络搜索技能,具备智能搜索策略、用户来源偏好及关键来源处理能力。
功能特性
- 1. 意图识别 - 自动分类查询(事实类、新闻类、研究类、对比类、教程类、学术类)
- 来源偏好 - 基于主题的域名路由(技术→GitHub、新闻→路透社、金融→华尔街日报)
- 搜索运算符 - 支持OR、site:、-、精确短语、时间筛选
- 关键来源校验 - 根据偏好来源验证结果,返回未找到结论
- 多API密钥轮换 - 遇到速率限制(429)时自动故障转移
- 离线报告 - 支持Markdown导出,包含来源覆盖分析
工具
| 工具 | 描述 |
|---|
| tavilysearch | 标准Tavily搜索 |
| webseeker |
具备所有功能的增强搜索 |
配置
API密钥
json
{
apiKey: { key1: tvly-xxx1, key2: tvly-xxx2 }
}
或环境变量:TAVILYAPIKEY、TAVILYAPIKEY_2
来源偏好
javascript
// 用户偏好
const PREFERENCES = {
default_sites: [wikipedia.org, github.com],
preferred_topics: {
tech: [wikipedia.org, github.com, stackoverflow.com],
news: [reuters.com, apnews.com, bbc.com],
finance: [wsj.com, bloomberg.com, ft.com],
academic: [scholar.google.com, arxiv.org]
},
critical_sources: {
官方: [gov.cn, moe.gov.cn],
财经: [wsj.com, bloomberg.com],
技术: [github.com, stackoverflow.com]
}
};
web_seeker参数
| 参数 | 类型 | 默认值 | 描述 |
|---|
| query | 字符串 | - | 搜索查询 |
| mode |
字符串 | quick | quick/research/compare |
| max_results | 数字 | 5 | 结果数1-20 |
| domains | 数组 | auto | 偏好域名 |
| time_range | 字符串 | auto | day/week/month/year |
| operators | 字符串 | - | 原始运算符 |
| strict_mode | 布尔值 | false | 仅要求偏好来源 |
| export_doc | 布尔值 | false | 生成报告 |
响应格式
json
{
original_query: 伊朗石油新闻,
intent: news,
domains_used: [reuters.com, bbc.com],
searchoperatorapplied: site:reuters.com OR site:bbc.com,
results_found: true,
source_coverage: { preferred: 3, total: 10 },
results: [...],
summary: ...
}
未找到响应
json
{
results_found: false,
notfoundconclusion: 在指定的核心信源中未搜索到...,
suggestions: [扩展搜索词, 放宽信源限制, 手动访问目标网站]
}
使用方法
bash
基础搜索
node seeker.js AI新闻
研究模式并生成报告
node seeker.js 机器学习 --mode research --export
严格模式(仅使用偏好来源)
node seeker.js Python教程 --strict