SuperAPI AI 工具集

lead-generation

营销与增长

查看项目

更新于 10-15 14:09

技能介绍

用途

该技能用于借助 Exa Agent API 生成经过信息丰富的潜在客户(lead)名单。一次 Agent 运行是一个异步、多步骤的网络研究任务:你描述想要的名单以及输出结构(output schema),Exa 会在内部完成查询分解、搜索、验证、信息补充和结构化输出。你无需自行编排并行搜索、子代理或手动去重。

对于规模非常大或需要持续维护、且需要逐项验证的名单,可考虑改用 Exa Websets:https://docs.exa.ai/websets/api/overview

前置条件

该技能需要启用 Agent 工具的 Exa MCP 服务器。使用 agent_tools URL 选择别名来启用 agent_run。

如果 Agent 工具不可用,请告知用户:

You need the Exa MCP server installed with the Agent tools and your API key. Instructions: https://docs.exa.ai/reference/exa-mcp

然后停止。

工具限制

使用 agent_run,以及 Write 和 Bash(用于输出 CSV)。不要使用通用网络搜索来生成名单本身。

工作流程

  1. 与用户确认 ICP(如需研究,可运行一次小型 Agent 任务)
  2. 使用 outputSchema 调用 agent_run
  3. 如果结果仍在运行,使用其 runId 再次调用 agent_run
  4. 从 agent_run 结果中读取 output.structured
  5. 写入 CSV
  6. 可选:通过后续运行扩展(previousRunId + input.exclusion)

第 1 步:理解 ICP

当用户说类似“为 [公司] 生成 200 条潜在客户名单”时,首先确立理想客户画像(ICP)。如果用户已经描述了 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。保持 schema 小而扁平、明确;始终用 maxItems 限定数组。

始终包含的核心字段:

  • company_name(string)
  • website(string)
  • product_description(string,“in 12 words or less”)
  • icp_fit_score(integer,1-10)
  • icp_fit_reasoning(string,“compelling one-liner in 20 words or less”)

添加针对活动定制的补充字段(融资阶段、员工规模范围、总部、招聘信号等)。为字符串字段在描述中给出长度提示,以保持 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)。

从 output.structured 读取 companies,从 output.grounding 读取 citations,从 agent_run 结果中的 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 结果中读取错误,调整查询或 schema,并用不同措辞重试一次
  • 如果需要客户端取消,中止进行中的 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 guide: https://docs.exa.ai/reference/agent-api-guide
  • Exa MCP setup: https://docs.exa.ai/reference/exa-mcp
  • Websets (verified list-building at scale): https://docs.exa.ai/websets/api/overview
  • Full docs for LLMs: https://docs.exa.ai/llms.txt