关于 lead-generation
lead-generation 是一项使用 Exa Agent API 研究并生成结构化潜在客户名单的技能,适用于营销和销售名单构建。它通过一次异步多步骤运行完成搜索、核实、信息补充和结构化输出,并可将结果写入 CSV。
主要功能
- 01按目标客户画像研究公司
- 02通过 Agent 运行搜索与核实
- 03按指定 schema 输出结构化数据
- 04支持排除项与后续扩展
- 05将结果排序并写入 CSV
适用场景
- 01为营销活动构建目标公司名单
- 02按地区和细分行业筛选潜在客户
- 03为公司名单补充融资或招聘信息
- 04分批扩展并去重大型名单
MCP 相关
该技能要求安装启用 Agent 工具的 Exa MCP 服务,并使用其 `agent_run` 工具进行研究。配置需要 Exa API 密钥。
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ exa-labs/ agent-skills --skill lead-generation安装后在 Claude Code 中输入/lead-generation确认已加载。
详细介绍
使用 Exa Agent 进行潜在客户开发
使用 Exa Agent API 生成经过信息丰富的潜在客户名单。Agent 运行是一项异步的多步骤网络研究任务:你描述所需名单及输出架构,Exa 会在内部处理查询拆解、搜索、验证、信息补充和结构化输出。你无需编排并行搜索、子 Agent 或手动去重。
对于需要逐项验证的超大型或持续维护的潜在客户名单,请考虑改用 Exa Websets:https://exa.ai/docs/websets/quickstart
前提条件
此技能需要启用了 Agent 工具的 Exa MCP 服务。使用 agent_tools URL 选择别名来启用 agent_run。
如果 Agent 工具不可用,请告知用户:
你需要安装启用了 Agent 工具的 Exa MCP 服务,并准备好 API 密钥。 说明:https://exa.ai/docs/get-started/exa-mcp
然后停止。
工具限制
使用 agent_run,以及 Write 和 Bash(用于 CSV 输出)。请勿使用通用网络搜索来生成潜在客户名单。
工作流
1. Confirm the ICP with the user (one small Agent run if research is needed)
2. Call `agent_run` with an outputSchema
3. If the result is still running, call `agent_run` again with its `runId`
4. Read `output.structured` from the `agent_run` result
5. Write the CSV
6. Optional: expand with follow-up runs (previousRunId + input.exclusion)
步骤 1:了解 ICP
当用户提出类似“为 [company] 制作一份包含 200 个潜在客户的名单”的要求时,首先确认理想客户画像。如果用户已经描述了 ICP,请先确认。如果没有,则运行一次小规模 Agent 任务来研究:
agent_run {
"query": "Research {company_name}: what they sell, who their existing customers are, and what their ideal customer profile is.",
"effort": "low",
"outputSchema": {
"type": "object",
"properties": {
"company_description": { "type": "string", "description": "What the company does in 2 sentences or less" },
"icp_description": { "type": "string", "description": "Concise ICP description that clearly defines target companies" },
"sub_verticals": { "type": "array", "maxItems": 10, "items": { "type": "string" }, "description": "Sub-verticals breaking down the ICP" },
"useful_enrichments": { "type": "array", "maxItems": 8, "items": { "type": "string" }, "description": "Enrichment columns useful for filtering high-signal companies" }
},
"required": ["company_description", "icp_description", "sub_verticals", "useful_enrichments"]
}
}
向用户展示 ICP 并确认:
- ICP 描述准确吗?
- 有哪些公司需要排除(竞争对手、现有客户)?
- 需要多少个潜在客户?(默认 200 个)
- 有特别关注的信息补充列吗?
步骤 2:创建潜在客户开发任务
设计一个包含有限长度 companies 数组的 outputSchema。架构应保持精简、扁平且明确;数组务必设置 maxItems 上限。
始终包含的核心字段:
company_name(字符串)website(字符串)product_description(字符串,“不超过 12 个单词”)icp_fit_score(整数,1-10)icp_fit_reasoning(字符串,“不超过 20 个单词的有力单句”)
根据营销活动添加信息补充字段(融资阶段、员工人数范围、总部所在地、招聘信号等)。在字符串字段的描述中注明长度限制,以保持 CSV 输出整洁。
设置以下运行输入:
query— 描述名单:ICP、地理位置、阶段以及所需公司数量outputSchema— 返回结果的确切结构,并通过maxItems限制companies数组systemPrompt— 评分规则、来源偏好,以及去重和排除要求input.exclusion— 要避开的公司(竞争对手、现有客户、此前运行的结果)effort— 默认设为"low";对于大型或难以生成的名单,设为"auto"、"high"或"xhigh"
示例:
agent_run {
"query": "Find 100 companies matching this ICP: {icp_description}. Prioritize {sub_verticals}. For each company, score ICP fit 1-10 for {user_company}.",
"effort": "low",
"systemPrompt": "Prefer official company sites and recent funding announcements. Do not include duplicates or subsidiaries of the same parent company.",
"input": {
"exclusion": [
{ "company_name": "{competitor_1}" },
{ "company_name": "{existing_customer_1}" }
]
},
"outputSchema": {
"type": "object",
"properties": {
"companies": {
"type": "array",
"maxItems": 100,
"items": {
"type": "object",
"properties": {
"company_name": { "type": "string" },
"website": { "type": "string", "format": "uri" },
"product_description": { "type": "string", "description": "in 12 words or less" },
"icp_fit_score": { "type": "integer", "description": "1-10" },
"icp_fit_reasoning": { "type": "string", "description": "one-liner in 20 words or less" }
},
"required": ["company_name", "website", "product_description", "icp_fit_score", "icp_fit_reasoning"]
}
}
},
"required": ["companies"]
}
}
agent_run 会在可能的情况下返回已完成的结果。如果返回 status: "running" 和一个 agent_run_... ID,请保存该 ID,然后仅使用 runId 继续调用 agent_run。
步骤 3:等待并读取输出
- 如果任务仍在运行,请使用其
runId调用agent_run,直到outputReady为 true,或任务达到终止状态(failed或cancelled)。 - 从
agent_run结果中的output.structured读取公司信息,从output.grounding读取引用,并从costDollars读取运行成本。
不要将完整原始输出粘贴到对话中——直接生成 CSV。
步骤 4:写入 CSV
将 output.structured.companies 写入 {target_company}_leads_{YYYY-MM-DD}.csv,并按 icp_fit_score 降序排列。将所有数组字段用 " | " 拼接。通过 Bash 使用 Python 的 csv.writer(可处理引号和转义),或者对小型名单直接使用 Write。
打印摘要:
## Lead Generation Complete
- Total leads: {count}
- ICP score distribution: 8-10: {N} | 5-7: {N} | 1-4: {N}
- Run ID: {agent_run_id}
- Cost: ${costDollars}
- Output: {filename}
步骤 5:扩展名单
如果用户需要的潜在客户数量超过单次运行返回的数量:
- 创建新的后续运行,将
previousRunId设为已完成运行的 ID,并要求提供更多公司 - 将已收集的公司记录放入
input.exclusion,以便新运行避开这些公司 - 将新结果追加到 CSV,并按规范化后的公司名称重新去重(去掉 "Inc"/"Ltd" 等后缀,忽略大小写)
对于数百条的名单,应按此方式依次运行几次,而不是进行一次庞大的运行;并先与用户确认范围:“这需要运行约 {N} 次 Agent。要继续吗?”
处理失败
- 如果运行以
failed结束,请从agent_run结果中读取错误信息,调整查询或架构,然后使用不同措辞重试一次 - 中止进行中的
agent_run调用不会取消该运行 - 如果结果数量始终低于要求,应将 ICP 缩小为 2–3 个子垂直领域,分别运行,而不是进行一次宽泛的运行
MCP 配置
需要 Exa API 密钥。请在 https://dashboard.exa.ai/api-keys 获取
{
"servers": {
"exa": {
"type": "http",
"url": "https://mcp.exa.ai/mcp?tools=agent_tools",
"headers": {
"x-api-key": "YOUR_EXA_API_KEY"
}
}
}
}
参考资料
- Exa Agent 指南:https://exa.ai/docs/agent/quickstart
- Exa MCP 设置:https://exa.ai/docs/get-started/exa-mcp
- Websets(大规模构建已验证名单):https://exa.ai/docs/websets/quickstart
- 面向大模型的完整文档:https://exa.ai/docs/llms.txt