关于 exa-search
exa-search 是一项技能,可根据意图选择并调用 Exa 端点,执行网页搜索、内容提取、相似页面查找、直接问答和结构化研究。它通过子技能将请求规划与 API 调用分开。
主要功能
- 01按意图选择 Exa 端点
- 02使用多种方式搜索网页
- 03提取结果 ID 对应的内容
- 04查找与指定 URL 相似的页面
- 05生成回答或按架构输出研究结果
适用场景
- 01跨网页研究某个主题
- 02获取搜索结果的完整内容
- 03查找与已知 URL 相关的页面
- 04获取直接答案或结构化报告
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ benedictking/ exa-search --skill exa-search安装后在 Claude Code 中输入/exa-search确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
.env.example.gitignoreexa-api.cjsexa-fetcher.md详细介绍
Exa 搜索技能
触发条件与端点选择
根据用户意图选择 Exa 端点:
- search:需要语义搜索/查找网页/研究主题
- contents:已知结果 ID,需要提取完整内容
- findsimilar:已知 URL,需要查找相似页面
- answer:需要直接回答问题
- research:需要根据给定的
output_schema获取结构化研究输出
推荐架构(主技能 + 子技能)
此技能采用两阶段架构:
- 主技能(当前上下文):理解用户问题 → 选择端点 → 组装 JSON 载荷
- 子技能(分叉上下文):仅负责执行 HTTP 调用,避免浪费对话历史令牌
执行方法
使用 Task 工具调用 exa-fetcher 子技能,并传入命令和 JSON(stdin):
Task parameters:
- subagent_type: Bash
- description: "Call Exa API"
- prompt: cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs <search|contents|findsimilar|answer|research>
{ ...payload... }
JSON
载荷示例
1) 搜索
cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs 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) 内容
cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs contents
{
"ids": ["result-id-1", "result-id-2"],
"text": true,
"highlights": true,
"summary": true
}
JSON
3) 查找相似内容
cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs findsimilar
{
"url": "https://example.com/article",
"numResults": 10,
"category": "news",
"includeDomains": [],
"excludeDomains": [],
"startPublishedDate": "2025-01-01",
"contents": {
"text": true,
"summary": true
}
}
JSON
4) 回答
cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs answer
{
"query": "What is the capital of France?",
"numResults": 5,
"includeDomains": [],
"excludeDomains": []
}
JSON
5) 研究
cat <<'JSON' | node .claude/skills/exa-search/exa-api.cjs 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
环境变量与 API 密钥
配置 API 密钥有两种方式(优先级:环境变量 > .env):
- 环境变量:
EXA_API_KEY .env文件:放置在.claude/skills/exa-search/.env,可从.env.example复制
响应格式
所有端点均返回 JSON,包含:
requestId:唯一请求标识符results:搜索结果数组searchType:执行的搜索类型(适用于 search 端点)context:便于大模型使用的上下文字符串(如有请求)costDollars:详细费用明细
评论
支持 Markdown