SuperAPI AI 工具集

exa-search

通用与其它

查看项目

更新于 10-16 02:20

技能介绍

用途

Exa Search 是一个 Claude Code 技能,用于通过 Exa AI 搜索 API 进行网络搜索与内容研究。它提供 5 个专用脚本,覆盖神经搜索、内容提取、相似页面发现、带引用的快速研究,以及异步专业研究。

使用前提:需要设置 EXA_API_KEY 环境变量,密钥可在 https://dashboard.exa.ai 获取。

主要能力

该技能包含 5 个脚本:

  1. exa_search.py — 神经网络搜索 支持基础搜索、按类别(company、research paper、news、pdf、github、personal site、people、financial report)过滤、域名过滤、时间过滤、深度搜索、RAG 上下文构建、instant 快速查询、结构化公司研究、快速事实回答等。

  2. exa_contents.py — URL 内容提取 可提取指定 URL 的内容,支持摘要、高亮、实时抓取(--livecrawl always)、限制字符数(--max-chars)等。

  3. exa_similar.py — 查找相似页面 基于给定 URL 查找相似页面,支持类别过滤、排除来源(--exclude-source)、比较摘要等,可用于发现竞品或相关论文。

  4. exa_research.py — AI 驱动研究 针对问题进行研究,支持引用来源(--sources)、实时流式输出(--stream)、域名限定、Markdown 输出(--markdown)、仅答案输出(--answer-only)。

  5. exa_research_async.py — 异步专业研究 支持 Pro 模型(--pro --wait)、快速模型(--fast)、结构化输出(--schema)、任务状态查询(status)、任务列表(list)。

使用方式

Token 高效搜索原则

该技能受 Anthropic 动态过滤启发,主张「先过滤再推理」,可减少约 24% token 并提升约 11% 准确率。原则为:廉价搜索 → 过滤 → 选择性提取 → 推理。

推荐做法:

# 步骤 1:使用 --no-text 搜索(仅标题/URL,最省)
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" -n 20 --no-text

# 步骤 2:评估标题,挑选最佳 3-5 个 URL

# 步骤 3:仅提取这些 URL,并限制内容量
python3 ~/.claude/skills/exa-search/scripts/exa_contents.py URL1 URL2 --highlights --max-chars 3000

不推荐:用全文搜索 50 条结果,然后对所有内容进行推理。

优先使用 API 级过滤(免费过滤)

  • --must-include "term" — 结果必须包含该字符串
  • --must-exclude "term" — 移除不相关结果
  • --domains site1.com site2.com — 限制为权威来源
  • --category "research paper" — 排除不相关内容类型
  • --after 2025-01-01 / --before — 时间过滤

使用摘要而非全文

python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" --summary "Key findings" -n 5

为 RAG 使用受限上下文

python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" --context --context-chars 5000

使用 filter_web_results.py 后处理

python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" --json | \
  python3 ~/.claude/skills/firecrawl/scripts/filter_web_results.py \
  --fields "title,url,text" --max-chars 3000

成本层级

类型 延迟 成本/1k 适用场景
--instant <150ms 最便宜 实时查询、自动补全
--fast ~500ms 低 快速检查、确认
auto(默认) -- 中 通用搜索
--deep 4-12s $12 综合研究
--deep-reasoning 12-50s $15 最大深度 + 综合

结构化深度搜索(Exa Deep)

Deep 和 deep-reasoning 搜索支持通过 outputSchema 输出结构化 JSON。API 在 output.content 中返回解析后的内容,并附带逐字段的 grounding 引用与置信度分数。

示例:

... --deep --text-output "Short answer"
... --deep-reasoning --schema-preset company
... --deep --output-schema '{"type":"object","properties":{"answer":{"type":"string"}}}'
... --deep --schema-file ~/schemas/analysis.json

预设:company、paper-survey、competitor-analysis、person、news-digest。输出包含字段级 grounding:逐字段引用,带 [H]igh/[M]edium/[L]ow 置信度。

脚本选择指南

任务 最佳脚本
带过滤的网络搜索 exa_search.py
研究论文 exa_search.py --category "research paper"
公司/初创信息 exa_search.py --category company
GitHub 仓库/代码 exa_search.py --category github
提取已知 URL 内容 exa_contents.py
查找竞品 exa_similar.py --exclude-source
带引用的快速回答 exa_research.py --sources
复杂结构化研究 exa_research_async.py --pro
实时搜索 exa_search.py --instant
RAG 上下文构建 exa_search.py --context
带 grounding 的结构化研究 exa_search.py --deep-reasoning --schema-preset company
快速事实回答 exa_search.py --deep --text-output "Short answer"

常见工作流

研究主题:

python3 ~/.claude/skills/exa-search/scripts/exa_research.py "How does RAG work?" --sources --markdown

文献综述:

python3 ~/.claude/skills/exa-search/scripts/exa_search.py "transformer optimization" --category "research paper" -n 20 --summary "Key contributions"
python3 ~/.claude/skills/exa-search/scripts/exa_similar.py "https://arxiv.org/abs/1706.03762" --category "research paper" -n 15

文档研究:

python3 ~/.claude/skills/exa-search/scripts/exa_search.py "React useEffect cleanup" --domains react.dev developer.mozilla.org --context

构建 RAG 上下文:

python3 ~/.claude/skills/exa-search/scripts/exa_search.py "Python async patterns" --context --context-chars 15000 --domains docs.python.org

测试套件

python3 ~/.claude/skills/exa-search/scripts/test_exa.py --quick       # 快速验证
python3 ~/.claude/skills/exa-search/scripts/test_exa.py               # 完整套件
python3 ~/.claude/skills/exa-search/scripts/test_exa.py --endpoint search  # 指定端点

参考文档

references/exa-scripts-reference.md 包含全部 5 个脚本的完整参数参考、成本表、MCP 对比与测试套件。

适用场景

  • 学术论文检索与文献综述
  • 公司与初创企业调研
  • 竞品发现
  • 技术文档研究
  • RAG 上下文构建
  • 带引用的快速研究回答
  • 结构化深度研究(公司、论文综述、竞品分析、人物、新闻摘要)

限制

  • 需要 EXA_API_KEY 环境变量,密钥需在 https://dashboard.exa.ai 获取。
  • 深度搜索(--deep、--deep-reasoning)延迟较高(4-50 秒)且成本较高($12-$15/1k)。
  • 部分功能(如结构化输出、grounding 引用)仅 deep 与 deep-reasoning 搜索支持。
  • 其他未在资料中明确说明的限制暂未提供。