exa-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseExa 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: environment variable. Get key at https://dashboard.exa.ai
EXA_API_KEY针对Exa AI搜索API的5个专用脚本——神经网络搜索、内容提取、相似页面查找、带引用的研究,以及异步专业研究。
前置条件: 环境变量。可前往 https://dashboard.exa.ai 获取密钥
EXA_API_KEYToken-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
undefinedStep 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:
- — results must contain this string
--must-include "term" - — removes irrelevant results
--must-exclude "term" - — restrict to authoritative sources
--domains site1.com site2.com - — eliminate irrelevant content types
--category "research paper" - /
--after 2025-01-01— temporal filtering--before
这些过滤规则会在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
undefinedAI-distilled summaries — much smaller than full text
AI提炼的摘要 — 比完整文本小得多
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" --summary "Key findings" -n 5
undefinedpython3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" --summary "Key findings" -n 5
undefinedUse Bounded Context for RAG
为RAG使用限定上下文
bash
undefinedbash
undefinedCapped context string — prevents unbounded token usage
受限的上下文字符串 — 避免无限制的Token消耗
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" --context --context-chars 5000
undefinedpython3 ~/.claude/skills/exa-search/scripts/exa_search.py "query" --context --context-chars 5000
undefinedPost-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 3000Cost Tiers — Match to Task
成本层级——按需选择
| Type | Latency | Cost | When |
|---|---|---|---|
| <150ms | Cheapest | Real-time lookups, autocomplete |
| ~500ms | Low | Quick checks, confirmations |
| — | Medium | General search |
| Slowest | Highest | Comprehensive research |
| 类型 | 延迟 | 成本 | 适用场景 |
|---|---|---|---|
| <150ms | 最低 | 实时查询、自动补全 |
| ~500ms | 低 | 快速核查、确认信息 |
| — | 中等 | 通用搜索 |
| 最慢 | 最高 | 全面研究 |
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 Example | Purpose |
|---|---|
| Basic search |
| Academic papers |
| Deep search |
| Domain-filtered |
| Recent news |
| RAG context |
| 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]| 快速示例 | 用途 |
|---|---|
| 基础搜索 |
| 学术论文搜索 |
| 深度搜索 |
| 域名过滤搜索 |
| 近期新闻搜索 |
| RAG上下文构建 |
| 亚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 Example | Purpose |
|---|---|
| Extract paper |
| Summarized extraction |
| Fresh content |
| Bounded extraction |
bash
python3 ~/.claude/skills/exa-search/scripts/exa_contents.py URL [URL2...] [options]| 快速示例 | 用途 |
|---|---|
| 提取论文内容 |
| 摘要式提取 |
| 获取最新内容 |
| 限定长度提取 |
3. exa_similar.py — Find Similar Pages
3. exa_similar.py — 查找相似页面
bash
python3 ~/.claude/skills/exa-search/scripts/exa_similar.py URL [options]| Quick Example | Purpose |
|---|---|
| Find competitors |
| Related papers |
| Comparison summaries |
bash
python3 ~/.claude/skills/exa-search/scripts/exa_similar.py URL [options]| 快速示例 | 用途 |
|---|---|
| 查找竞品网站 |
| 查找相关论文 |
| 对比摘要生成 |
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 Example | Purpose |
|---|---|
| Research with citations |
| Real-time streaming |
| Authoritative sources |
| Markdown with citations |
| Pipe-friendly output |
bash
python3 ~/.claude/skills/exa-search/scripts/exa_research.py "question" [options]| 快速示例 | 用途 |
|---|---|
| 带引用的研究 |
| 实时流式输出 |
| 权威来源研究 |
| 带引用的Markdown输出 |
| 管道友好型输出 |
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 Example | Purpose |
|---|---|
| Pro model |
| Fast model |
| Structured output |
| Check job |
| List jobs |
bash
python3 ~/.claude/skills/exa-search/scripts/exa_research_async.py "question" [options]| 快速示例 | 用途 |
|---|---|
| 使用专业模型 |
| 使用快速模型 |
| 结构化输出 |
| 检查任务状态 |
| 列出所有任务 |
Script Selection Guide
脚本选择指南
| Task | Best Script |
|---|---|
| Web search with filters | |
| Research papers | |
| Company/startup info | |
| GitHub repos/code | |
| Extract known URL content | |
| Find competitors | |
| Quick answers with citations | |
| Complex structured research | |
| Real-time search | |
| RAG context building | |
| 任务 | 最佳脚本 |
|---|---|
| 带过滤的网页搜索 | |
| 研究论文搜索 | |
| 企业/初创公司信息查找 | |
| GitHub仓库/代码搜索 | |
| 提取已知URL的内容 | |
| 查找竞品 | |
| 带引用的快速问答 | |
| 复杂结构化研究 | |
| 实时搜索 | |
| RAG上下文构建 | |
Exa vs Firecrawl vs Native Claude Tools
Exa vs Firecrawl vs 原生Claude工具
| Need | Best Tool | Why |
|---|---|---|
| Semantic/neural search | Exa | AI-powered relevance |
| Find research papers | Exa | Academic index |
| Quick research answer | Exa | Citations + synthesis |
| Find similar pages | Exa | Semantic similarity |
| Single page → markdown | Firecrawl | Cleanest output |
| Crawl entire site | Firecrawl | Link following |
| Autonomous data finding | Firecrawl | No URLs needed |
| Search + scrape combined | Firecrawl | One operation |
| Claude API agent building | Native | Built-in dynamic filtering |
| Twitter/X content | | Only tool that works |
| 需求 | 最佳工具 | 原因 |
|---|---|---|
| 语义/神经网络搜索 | Exa | AI驱动的相关性匹配 |
| 查找研究论文 | Exa | 学术索引覆盖 |
| 快速研究问答 | Exa | 引用支持+内容合成 |
| 查找相似页面 | Exa | 语义相似度匹配 |
| 单页面转Markdown | Firecrawl | 最简洁的输出 |
| 整站爬取 | Firecrawl | 支持链接遍历 |
| 自主式数据查找 | Firecrawl | 无需提供URL |
| 搜索+爬取一体化 | Firecrawl | 一站式操作 |
| Claude API Agent构建 | 原生 | 内置动态过滤 |
| Twitter/X内容获取 | | 唯一可用工具 |
Common Workflows
常见工作流
Research a Topic
研究某一主题
bash
python3 ~/.claude/skills/exa-search/scripts/exa_research.py "How does RAG work?" --sources --markdownbash
python3 ~/.claude/skills/exa-search/scripts/exa_research.py "How does RAG work?" --sources --markdownLiterature Review
文献综述
bash
undefinedbash
undefinedFind 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
undefinedpython3 ~/.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
undefinedDocumentation Research
文档研究
bash
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "React useEffect cleanup" --domains react.dev developer.mozilla.org --contextbash
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "React useEffect cleanup" --domains react.dev developer.mozilla.org --contextBuild RAG Context
构建RAG上下文
bash
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "Python async patterns" --context --context-chars 15000 --domains docs.python.orgbash
python3 ~/.claude/skills/exa-search/scripts/exa_search.py "Python async patterns" --context --context-chars 15000 --domains docs.python.orgReference Documentation
参考文档
| File | Contents |
|---|---|
| Full parameter reference for all 5 scripts, cost table, MCP comparison, test suite |
| 文件 | 内容 |
|---|---|
| 所有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 endpointbash
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 # 特定端点测试