# 使用 AI 查询邮件分析数据

使用连接到 [Bird MCP](/docs/ai/mcp-server) 的助手，用自然语言探索工作区的邮件统计数据。你可以比较表现、排查投递问题、请求时间序列，无需自己构造 API 请求。

将 Bird 连接到你的助手，并为要分析的工作区授予邮件读取权限。以下示例读取已有的活动数据。请将示例域名替换为你自己的域名，并选择有历史数据的时间段。助手会从你的连接中选择工具；下面的示例描述了你想要的报告。

## 查看表现

> Show my workspace's email deliveries, bounces, unique opens, unique clicks, open rate, and click rate for yesterday in UTC. Include an hourly breakdown.

预期结果包含整段时间的汇总和按小时的序列。整段时间的唯一计数和比率独立于按小时分桶计算；将分桶计数相加或对分桶比率取平均可能得到不同的结果。

## 区分营销和事务性流量

> Compare marketing and transactional email activity yesterday in UTC. Show deliveries, bounces, bounce rate, and delivery latency for each category. Keep receipts and password resets out of the marketing totals.

预期结果使用每个事件上记录的类别进行对比。模板或标签可以将报告缩小到特定流程。分类取决于消息的发送方式；助手无法仅从主题行可靠地推断分类。

## 比较模板

> Compare the email templates with activity yesterday in UTC. Rank the top ten by open rate and show deliveries and unique clicks alongside each rate. Use template names where you can resolve them, and show the IDs otherwise.

预期结果为每个模板一行。检查投递数量和比率：少量投递产生的高比率证据有限。从当前配置解析出的模板名称可能与发送消息时使用的名称不同。

## 排查投递问题

> Compare yesterday's bounce rate with the day before, using UTC. Break both periods down by recipient domain and show deliveries and bounces alongside the rates. Which domains account for the largest increases in bounce counts?

助手应在两个时间段内比较相同的群体。退回较多的域指示了调查方向；但仅凭分布本身无法确定原因。

## 比较带标签的营销活动

> Find the campaign tags used in my workspace yesterday, then compare delivery and engagement for those campaigns from mail.example.com. Rank them by click rate and include a 15-minute activity breakdown. Tell me if the tags do not clearly identify campaigns.

助手应先发现标签名称和值，然后再筛选报告。营销活动可以通过工作区中的发送时标签或广播 ID 来识别。模板可以在多个营销活动中复用，因此按模板分组可能会产生不同的报告。

如果你已经知道标签，可以直接在请求中包含它们：

> Compare the spring-sale and welcome values of our campaign tag yesterday in UTC. Exclude the Legacy welcome template. Show deliveries, unique clicks, and click rate by campaign.

助手应直接使用提供的标签，并将模板名称解析为其 ID。广播活动由所请求时间段内的事件决定；即使广播创建较早，今天仍然可能存在相关活动。

## 监控受众投诉

> For marketing email yesterday in UTC, compare complaints, unsubscribes, deliveries, complaint rate, and unsubscribe rate by campaign. Show the counts beside the rates so small campaigns do not dominate the interpretation.

结果应包含营销活动级别的调查信号。仅凭比率无法解释某人投诉或退订的原因，而样本量较小时比率可能看起来异常偏高。邮件服务商的垃圾邮件面板可能使用不同的统计群体和分母；请根据其自身报告来评估其阈值。

## 检查投递延迟

> For yesterday in UTC, compare median and 95th-percentile time from acceptance to delivery by mailbox provider. Include delivered counts and rank the providers by the 95th-percentile latency, slowest first.

结果应为每个服务商一行，延迟以毫秒为单位。中位数描述测量样本的中间值；第 95 百分位数有助于检查较慢的投递。缺少延迟样本时会产生空值。

对于事务性流程，请指定模板和关注的时间段：

> Customers reported slow password resets yesterday between 09:00 and 10:00 America/New_York. For our Password reset template, show deliveries and median and 95th-percentile delivery latency by mailbox provider, with 15-minute activity. Compare with the same hour the day before.

结果应为使用相同筛选条件独立计算的时间段对比。投递延迟衡量的是从接收到邮件服务器投递之间的时间，而非消息出现在收件箱中的时间，也不是收件人阅读消息的时间。百分位数同样无法给出超过某个延迟阈值的确切消息数量。

## 解读互动与业务成果

> Compare our marketing campaigns yesterday by unique clicks and click rate, with deliveries and unique opens for context. Explain what this tells us about engagement and what we would need to measure purchases.

预期结果为实测互动数据，并明确说明其局限性。预取打开可能导致打开计数虚高，而排除已知预取并不能证明是真人操作。投递确认不等于进入收件箱。购买归因需要邮件统计之外的订单或转化数据；仅凭较高的打开率不能判定 A/B 测试的胜出方。

## 优化报告

可以用更小的人群范围或不同的时间粒度继续追问：

> Keep the same period and metrics, but restrict the report to mail.example.com and show daily buckets.

[灵活查询端点](/docs/api/reference/get-email-stats-query)可将兼容的筛选条件与一个分组维度组合使用。如果请求的组合不受支持或历史数据不可用，请先让助手解释限制原因，再调整报告范围。

统计数据使用事件时间。昨天的一次打开可能属于更早发送的邮件。查询活动时，请指定活动时段；如果要了解某天发送的邮件的最终效果，则需要不同的人群。打开和点击是互动信号，不能证明某人阅读了邮件或完成了购买。

## 后续步骤

- [邮件统计 API](/docs/guides/email/stats-api)：聚合报告与明细
- [查询参考](/docs/api/reference/get-email-stats-query)：指标、筛选条件、时间窗口和分页
- [打开和点击追踪](/docs/guides/email/open-click-tracking)：互动事件的记录方式

## Related resources

- [Setting up your coding agent](/learn/basics/setting-up-your-coding-agent) (video)
- [What is an MCP server, and how does an agent use one to send messages?](/explained/platform/what-is-an-mcp-server-and-how-does-an-agent-send-messages) (answer)
- [Coding agents](/ai) (product)
- [Build with AI agents](/learn/paths/agents) (course)

[Get an implementation brief](/learn/workspace?topic=agents)
