关于 exa-search
为使用 Exa AI 搜索 API 的用户提供的搜索技能,包含网页搜索、内容提取、相似页面查找和研究脚本。支持筛选及结构化结果,适用于检索与资料研究。
主要功能
- 01神经网络网页搜索
- 02URL 内容提取与摘要
- 03查找相似页面
- 04带引用的 AI 研究
- 05异步专业研究与结构化输出
适用场景
- 01按域名和时间筛选网页结果
- 02提取指定页面并限制内容长度
- 03检索研究论文及相关页面
- 04构建带来源的研究或 RAG 上下文
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ tdimino/ claude-code-minoan --skill exa-search安装后在 Claude Code 中输入/exa-search确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
codex-agent-guide.mdREADME.mdreferences/exa-scripts-reference.mdscripts/exa_contents.pyexa_research_async.pyexa_research.pyexa_search.pyexa_similar.pytest_exa.py详细介绍
Exa 搜索技能
Exa AI 搜索 API 的 5 个专用脚本——神经搜索、内容提取、相似页面、带引用的研究和异步深度研究。
前置条件:EXA_API_KEY 环境变量。前往 https://dashboard.exa.ai 获取密钥。
节省 Token 的搜索
灵感来自 Anthropic 的动态过滤——推理前务必先过滤。Token 用量减少约 24%,准确率提高约 11%。
原则:低成本搜索 → 过滤 → 有选择地提取 → 推理
应该:
# Step 1: Search with --no-text (titles/URLs only — cheapest)
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" -n 20 --no-text
# Step 2: Evaluate titles, pick best 3-5 URLs
# Step 3: Extract only those URLs with bounded content
python3 ~/.claude/skills/exa-search/scripts/exa_contents.py URL1 URL2 --highlights --max-chars 3000
**不应该:**搜索 50 条结果的全文,然后对所有内容进行推理。
优先使用 API 级过滤器(免费过滤)
这些过滤器会在你看到结果之前,在 API 层面减少结果:
--must-include "term"— 结果必须包含此字符串--must-exclude "term"— 移除不相关结果--domains site1.com site2.com— 限定为权威来源--category "research paper"— 排除不相关的内容类型--after 2025-01-01/--before— 按时间过滤
优先使用摘要,而非全文
需要了解大意而非原始内容时:
# AI-distilled summaries — much smaller than full text
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" --summary "Key findings" -n 5
使用有界上下文进行 RAG
# Capped context string — prevents unbounded token usage
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" --context --context-chars 5000
使用 filter_web_results.py 进行后处理
将 Exa JSON 输出通过 Firecrawl 过滤脚本,以进一步减少内容:
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)
深度搜索和深度推理搜索支持通过 outputSchema 输出结构化 JSON。API 会在 output.content 中返回解析后的内容,并提供逐字段的依据引用和置信度评分。
| 快速示例 | 用途 |
|---|---|
... --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
输出包含字段级依据:逐字段引用,并标注 [H]高/[M]中/[L]低置信度。
可用脚本
1. exa_search.py — 神经网络网页搜索
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" [options]
| 快速示例 | 用途 |
|---|---|
... exa_search.py "AI frameworks" | 基本搜索 |
... exa_search.py "transformers" --category "research paper" -n 20 | 学术论文 |
... exa_search.py "query" --deep --additional-queries "alt query" | 深度搜索 |
... exa_search.py "query" --domains docs.python.org | 按域名过滤 |
... exa_search.py "query" --after 2025-01-01 --category news | 最新新闻 |
... exa_search.py "query" --context --context-chars 10000 | RAG 上下文 |
... exa_search.py "query" --instant -n 5 | 150ms 以内的查询 |
... exa_search.py "Top AI startups" --deep-reasoning --schema-preset company | 结构化公司研究 |
... exa_search.py "Who is CEO of Stripe?" --deep --text-output "Short answer" | 快速事实查询 |
**类别:**company、research paper、news、pdf、github、personal site、people、financial report
2. exa_contents.py — URL 内容提取
python3 ~/.claude/skills/exa-search/scripts/exa_contents.py URL [URL2...] [options]
| 快速示例 | 用途 |
|---|---|
... exa_contents.py "https://arxiv.org/abs/2307.06435" | 提取论文 |
... exa_contents.py URL --summary "Key methods" --highlights | 提取并生成摘要 |
... exa_contents.py URL --livecrawl always | 获取最新内容 |
... exa_contents.py URL --max-chars 5000 | 限长提取 |
3. exa_similar.py — 查找相似页面
python3 ~/.claude/skills/exa-search/scripts/exa_similar.py URL [options]
| 快速示例 | 用途 |
|---|---|
... exa_similar.py "https://stripe.com" --category company --exclude-source | 查找竞争对手 |
... exa_similar.py "https://arxiv.org/abs/..." -n 15 | 相关论文 |
... exa_similar.py URL --summary "How different?" | 生成对比摘要 |
4. exa_research.py — AI 驱动的研究
python3 ~/.claude/skills/exa-search/scripts/exa_research.py "question" [options]
| 快速示例 | 用途 |
|---|---|
... exa_research.py "React vs Vue differences?" --sources | 研究并附上引用 |
... exa_research.py "query" --stream | 实时流式输出 |
... exa_research.py "query" --domains docs.python.org | 权威来源 |
... exa_research.py "query" --markdown | Markdown 格式并附上引用 |
... exa_research.py "query" --answer-only | 适合管道处理的输出 |
5. exa_research_async.py — 异步专业研究
python3 ~/.claude/skills/exa-search/scripts/exa_research_async.py "question" [options]
| 快速示例 | 用途 |
|---|---|
... exa_research_async.py "Compare AI frameworks" --pro --wait | 专业模型 |
... exa_research_async.py "Quick overview" --fast | 快速模型 |
... exa_research_async.py "query" --schema '{...}' | 结构化输出 |
... exa_research_async.py status r_abc123 | 检查任务 |
... exa_research_async.py list | 列出任务 |
脚本选择指南
| 任务 | 最佳脚本 |
|---|---|
| 带筛选条件的网页搜索 | 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 |
| 带依据的结构化研究 | exa_search.py --deep-reasoning --schema-preset company |
| 快速事实性答案 | exa_search.py --deep --text-output "Short answer" |
Exa、Firecrawl 与 Claude 原生工具对比
| 需求 | 最佳工具 | 原因 |
|---|---|---|
| 语义/神经搜索 | Exa exa_search.py | AI 驱动的相关性排序 |
| 查找研究论文 | Exa --category "research paper" | 学术索引 |
| 获取快速研究答案 | Exa exa_research.py | 引用 + 综合整理 |
| 查找相似页面 | Exa exa_similar.py | 语义相似度 |
| 单个页面 → Markdown | Firecrawl scrape --only-main-content | 输出最简洁 |
| 抓取整个网站 | Firecrawl crawl --wait --progress | 跟踪链接 |
| 自主查找数据 | Firecrawl agent | 无需 URL |
| 组合搜索与抓取 | Firecrawl search --scrape | 一次操作完成 |
| 构建 Claude API Agent | 原生 web_search_20260209 | 内置动态筛选 |
| Twitter/X 内容 | jina URL | 唯一可用的工具 |
常见工作流
研究主题
python3 ~/.claude/skills/exa-search/scripts/exa_research.py "How does RAG work?" --sources --markdown
文献综述
# Find papers, then find similar to best hit
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
参考文档
| 文件 | 内容 |
|---|---|
references/exa-scripts-reference.md | 全部 5 个脚本的完整参数参考、费用表、MCP 对比、测试套件 |
测试套件
python3 ~/.claude/skills/exa-search/scripts/test_exa.py --quick # Quick validation
python3 ~/.claude/skills/exa-search/scripts/test_exa.py # Full suite
python3 ~/.claude/skills/exa-search/scripts/test_exa.py --endpoint search # Specific endpoint
评论
支持 Markdown