> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# 15. 数据接入与处理流程

根据代码整理后台数据怎样进入 Retaintive、经过什么处理，以及最终在哪些产品功能中使用。

| 数据来源                | 后台怎样处理                                                             | 形成的产品数据                                  | 主要边界                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------- | ------------------------------------------------------------------ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| RingCentral 电话事件    | Webhook 将电话事件送入通话处理队列，再按号码和门店配置继续处理                                | Calls 中的通话记录，以及后续录音、转录和分析所需的基础数据         | 依赖有效的 RingCentral 连接、号码归属和门店配置。[事件入口](https://github.com/retaintive/callytics-infrastructure/blob/a5801436771e0a84378fd9dbf2f1e1cfea37c69c/apps/api/src/webhook-receiver.ts#L137)                                                                                                                                                                                                                                                                                                                                              |
| 电话录音                | 通话结束后查询可用录音，处理录音延迟出现的情况，再按照配置执行转录                                  | Calls 中可回看的录音和逐字稿                        | 不是所有电话都有可用录音；转录策略按配置运行，并非每通电话都同时调用两个模型。[录音处理](https://github.com/retaintive/callytics-infrastructure/blob/a5801436771e0a84378fd9dbf2f1e1cfea37c69c/lambda/transcribe-processor/src/record-processor.ts#L1055) · [转录策略](https://github.com/retaintive/callytics-infrastructure/blob/a5801436771e0a84378fd9dbf2f1e1cfea37c69c/lambda/transcribe-processor/src/infrastructure/transcription-orchestrator.ts#L272)                                                                                                                 |
| SMS、MMS 和 Voicemail | message-store 事件进入消息队列，系统读取消息内容并保存可用附件                             | Contacts 中的沟通历史，以及 Voicemail 音频或供应商已有的转录 | 这里是接收和读取消息，不代表 Retaintive 已经自动向客户发送短信；缺少供应商转录时，自动补转录能力尚未确认。[事件分流](https://github.com/retaintive/callytics-infrastructure/blob/a5801436771e0a84378fd9dbf2f1e1cfea37c69c/apps/api/src/webhook-receiver.ts#L137) · [消息处理](https://github.com/retaintive/callytics-infrastructure/blob/a5801436771e0a84378fd9dbf2f1e1cfea37c69c/lambda/message-processor/src/core/message-processing.ts#L64)                                                                                                                                       |
| 通话转录                | AI 从逐字稿中形成摘要、类别、结果、业务信号和适用的 Coaching 信息                            | Calls 详情、Coaching 及后续 Task 判断使用的结构化信息    | 当前代码中的分析流程不再运行旧的 verify 二次模型调用，不能宣传为“双重验证”。[分析保存](https://github.com/retaintive/callytics-infrastructure/blob/a5801436771e0a84378fd9dbf2f1e1cfea37c69c/lambda/ai-analysis-processor/src/handler.ts#L1248) · [实际流程](https://github.com/retaintive/callytics-infrastructure/blob/a5801436771e0a84378fd9dbf2f1e1cfea37c69c/lambda/ai-analysis-processor/src/core/stages/pipeline.ts#L358)                                                                                                                                         |
| Email Lead          | 识别支持的 Lead 邮件，提取客户字段，按门店信号匹配归属，保存后通知下游                             | Leads Inbox 中的线索，以及后续 Task 处理的输入         | 当前支持 Web Lead、Online Intro 和 Zapier 转发格式；Facebook 来源通过转发邮件进入，不是原生 Facebook Lead Ads API。无法匹配门店的记录进入待处理区，未被识别为 Lead 的邮件不会进入后续流程。[邮件入口](https://github.com/retaintive/market-lead-tracking/blob/24670c753f52c7d81cbcc40f0ffd54918df2f4ee/src/index.ts#L54) · [识别与解析](https://github.com/retaintive/market-lead-tracking/blob/24670c753f52c7d81cbcc40f0ffd54918df2f4ee/src/parser.ts#L99) · [下游通知](https://github.com/retaintive/market-lead-tracking/blob/24670c753f52c7d81cbcc40f0ffd54918df2f4ee/src/downstream-ingest.ts#L59) |
| 已接入的客户数据            | Contacts Analyzer 汇总同一门店、同一客户的 Calls、Messages、Leads 和 Tasks，更新客户画像 | Contacts 中的客户档案、沟通历史及持续积累的客户情况           | AI 整理出的意愿、原因和问题属于分析结果，不能自动当成会员状态或付款事实；Contacts Analyzer 当前只更新画像，不负责写入 Task。[画像处理](https://github.com/retaintive/callytics-infrastructure/blob/a5801436771e0a84378fd9dbf2f1e1cfea37c69c/lambda/contacts-analyzer/src/handler.ts#L289)                                                                                                                                                                                                                                                                                           |

Email Lead 写入后，下游会按门店判断是新建 Task、复用已有开放 Task，还是拒绝重复或无效处理。具体的 Task 业务范围和自动化边界见下一节。[入库后的分派](https://github.com/retaintive/callytics-infrastructure/blob/a5801436771e0a84378fd9dbf2f1e1cfea37c69c/lambda/shared/lead/persist-downstream.ts#L1814) · [重复来询处理](https://github.com/retaintive/callytics-infrastructure/blob/a5801436771e0a84378fd9dbf2f1e1cfea37c69c/packages/task-engine/src/task-engine/email-lead-dispatch.ts#L531)
