exa-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Exa Search Skill

Exa 搜索Skill

Trigger Conditions & Endpoint Selection

触发条件与端点选择

Choose Exa endpoint based on user intent:
  • search: Need semantic search / find web pages / research topics
  • contents: Given result IDs, need to extract full content
  • findsimilar: Given URL, need to find similar pages
  • answer: Need direct answer to a question
  • research: Need structured research output following given
    output_schema
根据用户意图选择Exa端点:
  • search:需要语义搜索 / 查找网页 / 研究主题
  • contents:给定结果ID,需要提取完整内容
  • findsimilar:给定URL,需要查找相似页面
  • answer:需要问题的直接答案
  • research:需要遵循给定
    output_schema
    的结构化研究输出

Recommended Architecture (Main Skill + Sub-skill)

推荐架构(主Skill + 子Skill)

This skill uses a two-phase architecture:
  1. Main skill (current context): Understand user question → Choose endpoint → Assemble JSON payload
  2. Sub-skill (fork context): Only responsible for HTTP call execution, avoiding conversation history token waste
本Skill采用两阶段架构:
  1. 主Skill(当前上下文):理解用户问题 → 选择端点 → 组装JSON请求体
  2. 子Skill(分支上下文):仅负责HTTP调用执行,避免对话历史的token浪费

Execution Method

执行方法

Use Task tool to invoke
exa-fetcher
sub-skill, passing command and JSON (stdin):
Task parameters:
- subagent_type: Bash
- description: "Call Exa API"
- prompt: cat <<'JSON' | node .claude/skills/exa-search/exa-api.js <search|contents|findsimilar|answer|research>
  { ...payload... }
  JSON
使用Task工具调用
exa-fetcher
子Skill,传入命令和JSON(标准输入):
Task parameters:
- subagent_type: Bash
- description: "Call Exa API"
- prompt: cat <<'JSON' | node .claude/skills/exa-search/exa-api.js <search|contents|findsimilar|answer|research>
  { ...payload... }
  JSON

Payload Examples

请求体示例

1) Search

1) 搜索

bash
cat <<'JSON' | node .claude/skills/exa-search/exa-api.js search
{
  "query": "Latest research in LLMs",
  "type": "auto",
  "numResults": 10,
  "category": "research paper",
  "includeDomains": [],
  "excludeDomains": [],
  "startPublishedDate": "2025-01-01",
  "endPublishedDate": "2025-12-31",
  "includeText": [],
  "excludeText": [],
  "context": true,
  "contents": {
    "text": true,
    "highlights": true,
    "summary": true
  }
}
JSON
Search Types:
  • neural
    : Semantic search using embeddings
  • fast
    : Quick keyword-based search
  • auto
    : Automatically choose best method (default)
  • deep
    : Comprehensive deep search
Categories:
  • company
    ,
    people
    ,
    research paper
    ,
    news
    ,
    pdf
    ,
    github
    ,
    tweet
    , etc.
bash
cat <<'JSON' | node .claude/skills/exa-search/exa-api.js search
{
  "query": "Latest research in LLMs",
  "type": "auto",
  "numResults": 10,
  "category": "research paper",
  "includeDomains": [],
  "excludeDomains": [],
  "startPublishedDate": "2025-01-01",
  "endPublishedDate": "2025-12-31",
  "includeText": [],
  "excludeText": [],
  "context": true,
  "contents": {
    "text": true,
    "highlights": true,
    "summary": true
  }
}
JSON
搜索类型:
  • neural
    :基于嵌入向量的语义搜索
  • fast
    :快速关键词搜索
  • auto
    :自动选择最佳方式(默认)
  • deep
    :全面深度搜索
类别:
  • company
    ,
    people
    ,
    research paper
    ,
    news
    ,
    pdf
    ,
    github
    ,
    tweet

2) Contents

2) 内容提取

bash
cat <<'JSON' | node .claude/skills/exa-search/exa-api.js contents
{
  "ids": ["result-id-1", "result-id-2"],
  "text": true,
  "highlights": true,
  "summary": true
}
JSON
bash
cat <<'JSON' | node .claude/skills/exa-search/exa-api.js contents
{
  "ids": ["result-id-1", "result-id-2"],
  "text": true,
  "highlights": true,
  "summary": true
}
JSON

3) Find Similar

3) 查找相似内容

bash
cat <<'JSON' | node .claude/skills/exa-search/exa-api.js findsimilar
{
  "url": "https://example.com/article",
  "numResults": 10,
  "category": "news",
  "includeDomains": [],
  "excludeDomains": [],
  "startPublishedDate": "2025-01-01",
  "contents": {
    "text": true,
    "summary": true
  }
}
JSON
bash
cat <<'JSON' | node .claude/skills/exa-search/exa-api.js findsimilar
{
  "url": "https://example.com/article",
  "numResults": 10,
  "category": "news",
  "includeDomains": [],
  "excludeDomains": [],
  "startPublishedDate": "2025-01-01",
  "contents": {
    "text": true,
    "summary": true
  }
}
JSON

4) Answer

4) 问答

bash
cat <<'JSON' | node .claude/skills/exa-search/exa-api.js answer
{
  "query": "What is the capital of France?",
  "numResults": 5,
  "includeDomains": [],
  "excludeDomains": []
}
JSON
bash
cat <<'JSON' | node .claude/skills/exa-search/exa-api.js answer
{
  "query": "What is the capital of France?",
  "numResults": 5,
  "includeDomains": [],
  "excludeDomains": []
}
JSON

5) Research

5) 结构化研究

bash
cat <<'JSON' | node .claude/skills/exa-search/exa-api.js research
{
  "input": "What are the latest developments in AI?",
  "model": "auto",
  "stream": false,
  "output_schema": {
    "properties": {
      "topic": {
        "type": "string",
        "description": "The main topic"
      },
      "key_findings": {
        "type": "array",
        "description": "List of key findings",
        "items": {
          "type": "string"
        }
      }
    },
    "required": ["topic"]
  },
  "citation_format": "numbered"
}
JSON
bash
cat <<'JSON' | node .claude/skills/exa-search/exa-api.js research
{
  "input": "What are the latest developments in AI?",
  "model": "auto",
  "stream": false,
  "output_schema": {
    "properties": {
      "topic": {
        "type": "string",
        "description": "The main topic"
      },
      "key_findings": {
        "type": "array",
        "description": "List of key findings",
        "items": {
          "type": "string"
        }
      }
    },
    "required": ["topic"]
  },
  "citation_format": "numbered"
}
JSON

Environment Variables & API Key

环境变量与API密钥

Two ways to configure API Key (priority: environment variable >
.env
):
  1. Environment variable:
    EXA_API_KEY
  2. .env
    file: Place in
    .claude/skills/exa-search/.env
    , can copy from
    .env.example
配置API密钥的两种方式(优先级:环境变量 >
.env
文件):
  1. 环境变量:
    EXA_API_KEY
  2. .env
    文件:放置在
    .claude/skills/exa-search/.env
    ,可从
    .env.example
    复制

Response Format

响应格式

All endpoints return JSON with:
  • requestId
    : Unique request identifier
  • results
    : Array of search results
  • searchType
    : Type of search performed (for search endpoint)
  • context
    : LLM-friendly context string (if requested)
  • costDollars
    : Detailed cost breakdown
所有端点返回的JSON包含:
  • requestId
    :唯一请求标识符
  • results
    :搜索结果数组
  • searchType
    :执行的搜索类型(仅search端点返回)
  • context
    :适合LLM的上下文字符串(若请求)
  • costDollars
    :详细费用明细