exa-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Exa Search Skill

Exa 搜索技能

5 specialized scripts for Exa AI search API—neural search, content extraction, similar pages, research with citations, and async pro research.
Prerequisite:
EXA_API_KEY
environment variable. Get key at https://dashboard.exa.ai
针对Exa AI搜索API的5个专用脚本——神经网络搜索、内容提取、相似页面查找、带引用的研究,以及异步专业研究。
前置条件:
EXA_API_KEY
环境变量。可前往 https://dashboard.exa.ai 获取密钥

Token-Efficient Search

节省Token的搜索

Inspired by Anthropic's dynamic filtering—always filter before reasoning. ~24% fewer tokens, ~11% better accuracy.
灵感来源于Anthropic的动态过滤——始终先过滤再推理。可减少约24%的Token使用量,同时提升约11%的准确率。

The Principle: Search Cheaply → Filter → Extract Selectively → Reason

核心原则:低成本搜索 → 过滤 → 选择性提取 → 推理

DO:
bash
undefined
推荐做法:
bash
undefined

Step 1: Search with --no-text (titles/URLs only — cheapest)

步骤1:使用--no-text进行搜索(仅标题/URL — 成本最低)

python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" -n 20 --no-text
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" -n 20 --no-text

Step 2: Evaluate titles, pick best 3-5 URLs

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

Step 3: Extract only those URLs with bounded content

步骤3:仅提取这些URL的限定内容

python3 ~/.claude/skills/exa-search/scripts/exa_contents.py URL1 URL2 --highlights --max-chars 3000

**DON'T:** Search with full text for 50 results, then reason over all of it.
python3 ~/.claude/skills/exa-search/scripts/exa_contents.py URL1 URL2 --highlights --max-chars 3000

**不推荐做法:** 搜索50条完整文本结果,再对所有结果进行推理。

Use API-Level Filters First (Free Filtering)

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

These reduce results at the API level before you ever see them:
  • --must-include "term"
    — results must contain this string
  • --must-exclude "term"
    — removes irrelevant results
  • --domains site1.com site2.com
    — restrict to authoritative sources
  • --category "research paper"
    — eliminate irrelevant content types
  • --after 2025-01-01
    /
    --before
    — temporal filtering
这些过滤规则会在API层面先缩减结果数量,无需你手动处理:
  • --must-include "term"
    — 结果必须包含指定字符串
  • --must-exclude "term"
    — 移除不相关结果
  • --domains site1.com site2.com
    — 限定为权威来源域名
  • --category "research paper"
    — 排除无关内容类型
  • --after 2025-01-01
    /
    --before
    — 时间范围过滤

Use Summaries Over Full Text

优先使用摘要而非完整文本

When you need the gist, not raw content:
bash
undefined
当你只需要核心要点而非原始内容时:
bash
undefined

AI-distilled summaries — much smaller than full text

AI提炼的摘要 — 比完整文本小得多

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

Use Bounded Context for RAG

为RAG使用限定上下文

bash
undefined
bash
undefined

Capped context string — prevents unbounded token usage

受限的上下文字符串 — 避免无限制的Token消耗

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

Post-Process with filter_web_results.py

使用filter_web_results.py进行后处理

Pipe Exa JSON output through the Firecrawl filter script for additional reduction:
bash
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
将Exa的JSON输出通过Firecrawl过滤脚本进一步缩减:
bash
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

Cost Tiers — Match to Task

成本层级——按需选择

TypeLatencyCostWhen
--instant
<150msCheapestReal-time lookups, autocomplete
--fast
~500msLowQuick checks, confirmations
auto
(default)
MediumGeneral search
--deep
SlowestHighestComprehensive research

类型延迟成本适用场景
--instant
<150ms最低实时查询、自动补全
--fast
~500ms快速核查、确认信息
auto
(默认)
中等通用搜索
--deep
最慢最高全面研究

Available Scripts

可用脚本

1. exa_search.py — Neural Web Search

1. exa_search.py — 神经网络网页搜索

bash
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" [options]
Quick ExamplePurpose
... exa_search.py "AI frameworks"
Basic search
... exa_search.py "transformers" --category "research paper" -n 20
Academic papers
... exa_search.py "query" --deep --additional-queries "alt query"
Deep search
... exa_search.py "query" --domains docs.python.org
Domain-filtered
... exa_search.py "query" --after 2025-01-01 --category news
Recent news
... exa_search.py "query" --context --context-chars 10000
RAG context
... exa_search.py "query" --instant -n 5
Sub-150ms lookup
Categories: company, research paper, news, pdf, github, tweet, personal site, people, financial report
bash
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级查询
支持的分类: company、research paper、news、pdf、github、tweet、personal site、people、financial report

2. exa_contents.py — URL Content Extraction

2. exa_contents.py — URL内容提取

bash
python3 ~/.claude/skills/exa-search/scripts/exa_contents.py URL [URL2...] [options]
Quick ExamplePurpose
... exa_contents.py "https://arxiv.org/abs/2307.06435"
Extract paper
... exa_contents.py URL --summary "Key methods" --highlights
Summarized extraction
... exa_contents.py URL --livecrawl always
Fresh content
... exa_contents.py URL --max-chars 5000
Bounded extraction
bash
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 — Find Similar Pages

3. exa_similar.py — 查找相似页面

bash
python3 ~/.claude/skills/exa-search/scripts/exa_similar.py URL [options]
Quick ExamplePurpose
... exa_similar.py "https://stripe.com" --category company --exclude-source
Find competitors
... exa_similar.py "https://arxiv.org/abs/..." -n 15
Related papers
... exa_similar.py URL --summary "How different?"
Comparison summaries
bash
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-Powered Research

4. exa_research.py — AI驱动的研究

bash
python3 ~/.claude/skills/exa-search/scripts/exa_research.py "question" [options]
Quick ExamplePurpose
... exa_research.py "React vs Vue differences?" --sources
Research with citations
... exa_research.py "query" --stream
Real-time streaming
... exa_research.py "query" --domains docs.python.org
Authoritative sources
... exa_research.py "query" --markdown
Markdown with citations
... exa_research.py "query" --answer-only
Pipe-friendly output
bash
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 — Async Pro Research

5. exa_research_async.py — 异步专业研究

bash
python3 ~/.claude/skills/exa-search/scripts/exa_research_async.py "question" [options]
Quick ExamplePurpose
... exa_research_async.py "Compare AI frameworks" --pro --wait
Pro model
... exa_research_async.py "Quick overview" --fast
Fast model
... exa_research_async.py "query" --schema '{...}'
Structured output
... exa_research_async.py status r_abc123
Check job
... exa_research_async.py list
List jobs

bash
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
列出所有任务

Script Selection Guide

脚本选择指南

TaskBest Script
Web search with filters
exa_search.py
Research papers
exa_search.py --category "research paper"
Company/startup info
exa_search.py --category company
GitHub repos/code
exa_search.py --category github
Extract known URL content
exa_contents.py
Find competitors
exa_similar.py --exclude-source
Quick answers with citations
exa_research.py --sources
Complex structured research
exa_research_async.py --pro
Real-time search
exa_search.py --instant
RAG context building
exa_search.py --context
任务最佳脚本
带过滤的网页搜索
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 vs Firecrawl vs Native Claude Tools

Exa vs Firecrawl vs 原生Claude工具

NeedBest ToolWhy
Semantic/neural searchExa
exa_search.py
AI-powered relevance
Find research papersExa
--category "research paper"
Academic index
Quick research answerExa
exa_research.py
Citations + synthesis
Find similar pagesExa
exa_similar.py
Semantic similarity
Single page → markdownFirecrawl
scrape --only-main-content
Cleanest output
Crawl entire siteFirecrawl
crawl --wait --progress
Link following
Autonomous data findingFirecrawl
agent
No URLs needed
Search + scrape combinedFirecrawl
search --scrape
One operation
Claude API agent buildingNative
web_search_20260209
Built-in dynamic filtering
Twitter/X content
jina URL
Only tool that works

需求最佳工具原因
语义/神经网络搜索Exa
exa_search.py
AI驱动的相关性匹配
查找研究论文Exa
--category "research paper"
学术索引覆盖
快速研究问答Exa
exa_research.py
引用支持+内容合成
查找相似页面Exa
exa_similar.py
语义相似度匹配
单页面转MarkdownFirecrawl
scrape --only-main-content
最简洁的输出
整站爬取Firecrawl
crawl --wait --progress
支持链接遍历
自主式数据查找Firecrawl
agent
无需提供URL
搜索+爬取一体化Firecrawl
search --scrape
一站式操作
Claude API Agent构建原生
web_search_20260209
内置动态过滤
Twitter/X内容获取
jina URL
唯一可用工具

Common Workflows

常见工作流

Research a Topic

研究某一主题

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

Literature Review

文献综述

bash
undefined
bash
undefined

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
undefined
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
undefined

Documentation Research

文档研究

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

Build RAG Context

构建RAG上下文

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

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

Reference Documentation

参考文档

FileContents
references/exa-scripts-reference.md
Full parameter reference for all 5 scripts, cost table, MCP comparison, test suite
文件内容
references/exa-scripts-reference.md
所有5个脚本的完整参数参考、成本表、MCP对比、测试套件说明

Test Suite

测试套件

bash
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
bash
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  # 特定端点测试