Tavily Summary
AI-optimized web search with structured summarization methodology, combining:
- - Tavily Search API for clean, relevant search results (AI-native)
- Proven summarization rules extracted from the
summarize project - Output follows consistent formatting rules for readability
Features
- - Search the web with AI optimization (better than plain search engines for AI agents)
- Automatically summarizes results following structured formatting rules:
- Strict length control, no padding
- Automatic heading hierarchy for long content
- Proper citation of key excerpts
- Ad/sponsor content automatically stripped
- Consistent Markdown formatting
Usage
Search
CODEBLOCK0
Options
- -
-n <count>: Number of results (default: 5, max: 20) - INLINECODE2 : Use advanced search for deeper research (slower, more comprehensive)
- INLINECODE3 : Search topic -
general (default) or INLINECODE5 - INLINECODE6 : For news topic, limit to last n days
Extract content from URL
CODEBLOCK1
Output Summary Rules
Core Principles
- - Positioning: Extract key points for users, let them quickly grasp core info and decide whether to read in depth
- Authenticity: 100% based on search results, never fabricate information
- Conciseness: Strictly control length, prefer shorter, never pad for no reason
- Formatting: Use Markdown formatting, long content must split into sections with headings
Formatting Rules
- - Content longer than 500 characters equivalent → split with
### prefixed Markdown headings, at least 3 headings - Short paragraphs, use bullet points only when improves readability, don't force rigid templates
- Include 1-2 short exact excerpts (max 25 words each) as italicized, ignore ads/sponsors/promotions completely, treat them as if they don't exist, don't mention ignoring them
Output Structure (for news search example)
- 1. One sentence opening summary of the core conclusion
- Break into points/events, each with core idea + key data
- (Optional) 1-2 italicized original excerpts
- One sentence closing summary
Absolute Prohibitions
- - ❌ Never include ads/sponsors/promotions/CTAs, delete directly
- ❌ Use straight quotes only, no curly quotes
- ❌ Don't add emojis, disclaimers, unfounded speculation
- ❌ Never exceed requested length, finish early if content is short, don't pad
- ❌ Don't fabricate excerpts, omit if no suitable excerpt exists
Requirements
- -
TAVILY_API_KEY from https://tavily.com (free plan available: 1,000 searches/month) - Node.js 18+
Credits
- - Search API provided by Tavily
- Summarization methodology refined from summarize
Tavily 摘要
采用结构化摘要方法论的AI优化网络搜索,结合:
- - Tavily搜索API,获取干净、相关的搜索结果(AI原生)
- 从summarize项目中提取的成熟摘要规则
- 输出遵循一致的格式化规则,确保可读性
功能特性
- - 使用AI优化进行网络搜索(对AI代理而言优于普通搜索引擎)
- 自动按照结构化格式规则对结果进行摘要:
- 严格控制长度,不填充内容
- 长内容自动生成标题层级
- 关键引文正确标注
- 自动剔除广告/赞助内容
- 统一的Markdown格式
使用方法
搜索
bash
node {baseDir}/scripts/search.mjs 查询内容
node {baseDir}/scripts/search.mjs 查询内容 -n 10
node {baseDir}/scripts/search.mjs 查询内容 --deep
node {baseDir}/scripts/search.mjs 查询内容 --topic news
node {baseDir}/scripts/search.mjs 查询内容 --topic news --days 30
选项参数
- - -n <数量>:返回结果数量(默认:5,最大:20)
- --deep:使用高级搜索进行深度研究(较慢,更全面)
- --topic <主题>:搜索主题 - general(默认)或 news
- --days <天数>:新闻主题时,限制为最近n天
从URL提取内容
bash
node {baseDir}/scripts/extract.mjs https://example.com/article
输出摘要规则
核心原则
- - 定位:为用户提取关键点,使其快速掌握核心信息并决定是否深入阅读
- 真实性:100%基于搜索结果,绝不编造信息
- 简洁性:严格控制长度,宁短勿长,绝不无故填充
- 格式化:使用Markdown格式,长内容必须分节并添加标题
格式规则
- - 内容超过500字符等效长度 → 使用### 前缀的Markdown标题分割,至少3个标题
- 使用短段落,仅在提升可读性时使用项目符号,不强制使用固定模板
- 包含1-2个简短精确的引文(每个最多25词),以斜体呈现,完全忽略广告/赞助/推广内容,视其不存在,不提及忽略行为
输出结构(以新闻搜索为例)
- 1. 一句核心结论的开篇摘要
- 分解为要点/事件,每个包含核心观点+关键数据
- (可选)1-2条斜体原始引文
- 一句总结收尾
绝对禁止事项
- - ❌ 绝不包含广告/赞助/推广/行动号召,直接删除
- ❌ 仅使用直引号,不使用弯引号
- ❌ 不添加表情符号、免责声明、无根据的推测
- ❌ 绝不超出要求长度,内容简短时提前结束,不填充
- ❌ 不编造引文,无合适引文时省略
环境要求
- - 来自 https://tavily.com 的 TAVILYAPIKEY(免费计划:每月1,000次搜索)
- Node.js 18+
致谢