lead-generation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Lead Generation with Exa Agent

使用Exa Agent生成潜在客户

Generate enriched lead lists using the Exa Agent API. An Agent run is an asynchronous, multi-step web research task: you describe the list you want plus an output schema, and Exa handles query decomposition, searching, verification, enrichment, and structured output internally. You do NOT need to orchestrate parallel searches, subagents, or manual deduplication.
For very large or continuously maintained lead lists with per-item verification, consider Exa Websets instead: https://docs.exa.ai/websets/api/overview
通过Exa Agent API生成丰富的潜在客户列表。Agent运行是一项异步的多步骤网络研究任务:您只需描述所需列表及输出schema,Exa会在内部处理查询分解、搜索、验证、信息补充和结构化输出。您无需协调并行搜索、子Agent或手动去重。
对于需要逐项验证的超大型或持续维护的潜在客户列表,建议改用Exa Websets:https://docs.exa.ai/websets/api/overview

Prerequisites

前提条件

This skill requires the Exa MCP server with the Agent tool enabled. Use the
agent_tools
URL selection alias to enable
agent_run
.
If the Agent tools are not available, tell the user:
You need the Exa MCP server installed with the Agent tools and your API key. Instructions: https://docs.exa.ai/reference/exa-mcp
Then stop.
本技能需要启用Agent工具的Exa MCP服务器。使用
agent_tools
URL选择别名来启用
agent_run
功能。
如果Agent工具不可用,请告知用户:
您需要安装带有Agent工具的Exa MCP服务器并配置您的API密钥。 操作说明:https://docs.exa.ai/reference/exa-mcp
然后停止操作。

Tool Restriction

工具限制

Use
agent_run
, plus Write and Bash (for CSV output). Do NOT use generic web search for the lead list itself.
使用
agent_run
,以及Write和Bash工具(用于CSV输出)。请勿对潜在客户列表本身使用通用网络搜索。

Workflow

工作流程

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(如需调研,可运行一次小型Agent任务)
2. 调用带有outputSchema的`agent_run`
3. 如果结果仍在运行,使用其`runId`再次调用`agent_run`
4. 从`agent_run`结果中读取`output.structured`
5. 写入CSV文件
6. 可选:通过后续运行扩展列表(使用previousRunId + input.exclusion)

Step 1: Understand the ICP

步骤1:理解ICP

When the user says something like "Make a list of 200 leads for [company]", first establish the Ideal Customer Profile. If the user already described the ICP, confirm it. If not, run one small Agent run to research it:
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"]
  }
}
Present the ICP to the user and confirm:
  • Is the ICP description accurate?
  • Any companies to exclude (competitors, existing customers)?
  • How many leads do they want? (default 200)
  • Any specific enrichment columns they care about?
当用户提出类似“为[公司]生成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条)
  • 是否有特定需要补充的列?

Step 2: Create the Lead-Gen Run

步骤2:创建潜在客户生成任务

Design an
outputSchema
with a bounded
companies
array. Keep schemas small, flat, and explicit; always bound arrays with
maxItems
.
Core fields to always include:
  • 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")
Add enrichment fields tailored to the campaign (funding stage, headcount range, headquarters, hiring signals, etc.). Give string fields a length hint in their description to keep CSV output clean.
Use the run inputs for the pieces the old manual pipeline handled by hand:
  • query
    — describe the list: the ICP, geography, stage, and how many companies you want
  • outputSchema
    — the exact structure back, with
    maxItems
    bounding the companies array
  • systemPrompt
    — scoring rules, source preferences, dedup/exclusion emphasis
  • input.exclusion
    — companies to avoid (competitors, existing customers, results from earlier runs)
  • effort
    "low"
    by default;
    "auto"
    ,
    "high"
    , or
    "xhigh"
    for large or hard lists
Example:
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
returns the completed result when possible. If it returns
status: "running"
with an
agent_run_...
ID, save the ID and continue with
agent_run
using only
runId
.
设计包含有限
companies
数组的
outputSchema
。保持schema简洁、扁平且明确;始终用
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

Step 3: Wait and Read Output

步骤3:等待并读取输出

  1. If the run is still running, call
    agent_run
    with its
    runId
    until
    outputReady
    is true or the run reaches a terminal status (
    failed
    or
    cancelled
    ).
  2. Read the companies from
    output.structured
    , citations from
    output.grounding
    , and the run cost from
    costDollars
    in the
    agent_run
    result.
Do not paste the full raw output into the conversation — go straight to CSV.
  1. 如果任务仍在运行,使用其
    runId
    调用
    agent_run
    ,直到
    outputReady
    为true或任务进入终端状态(
    failed
    cancelled
    )。
  2. agent_run
    结果中读取
    output.structured
    中的公司信息、
    output.grounding
    中的引用以及
    costDollars
    中的任务成本。
请勿将完整的原始输出粘贴到对话中——直接生成CSV文件。

Step 4: Write the CSV

步骤4:写入CSV文件

Write
output.structured.companies
to
{target_company}_leads_{YYYY-MM-DD}.csv
, sorted by
icp_fit_score
descending. Join any array fields with " | ". Use Python's
csv.writer
(handles quoting/escaping) via Bash, or Write directly for small lists.
Print a summary:
undefined
output.structured.companies
写入
{target_company}_leads_{YYYY-MM-DD}.csv
,按
icp_fit_score
降序排序。用" | "连接任何数组字段。通过Bash使用Python的
csv.writer
(处理引用/转义),或对于小型列表直接使用Write工具。
打印摘要:
undefined

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}
undefined
  • 总潜在客户数:{count}
  • ICP评分分布:8-10分:{N} | 5-7分:{N} | 1-4分:{N}
  • 任务ID:{agent_run_id}
  • 成本:${costDollars}
  • 输出文件:{filename}
undefined

Step 5: Expanding the List

步骤5:扩展列表

If the user wants more leads than one run returned:
  • Create a new follow-up run with
    previousRunId
    set to the completed run's ID, asking for additional companies
  • Put the company records already collected into
    input.exclusion
    so the new run avoids them
  • Append the new results to the CSV and re-deduplicate by normalized company name (strip "Inc"/"Ltd"/etc., case-insensitive)
For lists in the many hundreds, run a few runs sequentially this way rather than one giant run, and confirm scope with the user first: "This will require ~{N} Agent runs. Proceed?"
如果用户需要比单次任务返回更多的潜在客户:
  • 创建新的后续任务,将
    previousRunId
    设置为已完成任务的ID,请求更多公司
  • 将已收集的公司记录放入
    input.exclusion
    ,以便新任务避开这些公司
  • 将新结果追加到CSV文件,并按标准化公司名称去重(去除"Inc"/"Ltd"等后缀,不区分大小写)
对于数百条规模的列表,建议分几次运行而非一次大型任务,并且先与用户确认范围:"这需要约{N}次Agent运行。是否继续?"

Handling Failures

故障处理

  • If a run ends
    failed
    , read the error from the
    agent_run
    result, adjust the query or schema, and retry once with different wording
  • If a client cancellation is needed, abort the in-progress
    agent_run
    call
  • If results are consistently below the requested count, narrow the ICP into 2-3 sub-vertical runs instead of one broad run
  • 如果任务以
    failed
    结束,从
    agent_run
    结果中读取错误信息,调整查询或schema,并用不同措辞重试一次
  • 如果需要取消客户端请求,中止正在进行的
    agent_run
    调用
  • 如果结果持续少于请求数量,将ICP拆分为2-3个细分垂直领域的任务,而非单次宽泛任务

MCP Configuration

MCP配置

Requires an Exa API key. Get yours at https://dashboard.exa.ai/api-keys
json
{
  "servers": {
    "exa": {
      "type": "http",
      "url": "https://mcp.exa.ai/mcp?tools=agent_tools",
      "headers": {
        "x-api-key": "YOUR_EXA_API_KEY"
      }
    }
  }
}
json
{
  "servers": {
    "exa": {
      "type": "http",
      "url": "https://mcp.exa.ai/mcp?tools=agent_tools",
      "headers": {
        "x-api-key": "YOUR_EXA_API_KEY"
      }
    }
  }
}

References

参考资料