Workflows2026年5月8日·1 分钟阅读

Tavily Search — Search API Built for AI Agents

Tavily Search returns LLM-ready answers from the web — not link lists. One call gets snippets, citations, optional generated answer. Free tier 1K/mo.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Stage only · 5/100Stage only
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Stage only
信任
信任等级:New
入口
Asset
通用 CLI 安装命令
npx tokrepo install b2f4accc-45ba-44f3-9a1e-aea8c3096e0d

简介

Tavily Search 是为 AI agent 和 RAG 设计的搜索 API。不像 Google Custom Search 或 Bing API,Tavily 返回精选的内容片段直接喂 LLM —— 不是要再去 scrape 的 URL 列表。可选的 include_answer 给出综合答案。适合需要新事实、引用、实时信息的 AI agent。兼容 Tavily REST API / Python / TypeScript SDK / MCP server。装机时间 2 分钟。


Hello world

from tavily import TavilyClient

client = TavilyClient(api_key=os.environ["TAVILY_API_KEY"])

response = client.search(
    query="What is the latest version of Python?",
    search_depth="advanced",
    include_answer=True,
    include_raw_content=False,
    max_results=5,
)

print(response["answer"])
# "As of October 2024, the latest stable version of Python is 3.13.0..."

for r in response["results"]:
    print(f"{r['title']}{r['url']}")
    print(r["content"][:200])

搜索深度

模式 用途 成本
basic 快速事实查询 1 credit
advanced 多源研究、RAG 2 credits

advanced 模式爬更多源 + 重排,答案质量更好,延迟和成本略高。

按域名过滤

# 白名单
response = client.search(
    query="Latest LangChain release notes",
    include_domains=["python.langchain.com", "github.com"],
)

# 黑名单
response = client.search(
    query="Best vector databases",
    exclude_domains=["medium.com"],  # 避开 SEO blogspam
)

当 MCP

{
  "mcpServers": {
    "tavily": {
      "command": "npx",
      "args": ["-y", "tavily-mcp"],
      "env": { "TAVILY_API_KEY": "tvly-..." }
    }
  }
}

Claude Code / Cursor 直接调 tavily_search / tavily_extract / tavily_crawl


FAQ

Q: Tavily 免费吗? A: 免费 —— 免费档每月 1000 API credit,不要信用卡。付费档加更高配额和团队功能。价格见 tavily.com。

Q: Tavily 跟 SerpAPI 调 Google 啥区别? A: SerpAPI 返回 Google 的 HTML 自然结果,你自己 scrape + 清洗。Tavily 已经做了清洗、排序、可选的综合。Tavily 为 LLM 消费打造;SerpAPI 为 SERP scraping 打造。

Q: 能配 LangChain 用吗? A: 能 —— langchain_community.tools.tavily_search.TavilySearchResults 是 LangChain 内置工具。LlamaIndex / CrewAI / Pydantic AI 同样。


🙏

来源与感谢

Built by Tavily. Commercial product with free tier.

tavily-ai/tavily-python — ⭐ Active

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产