智能体式 CDP 数据建模最佳实践,第 1 部分:数据基础

在 silver 层之后只做一次身份解析,然后基于一个规范 ID 构建 gold 层。在 Medallion 架构中,原始数据落在 bronze 层,并在 silver 层得到清洗。身份解析随后创建一个持久的 canonical_id,而 gold 层则由客户表、1:1 属性表和 1:many 行为表构建。
将每个 gold 表标记为批处理或事件,并把响应作为数据落地。事件表构建为流式表,再加上将互动和结果与留出组一起存储,意味着你之后无需重新建模,就能添加基于触发器的营销活动并实现闭环衡量。
一位顾客 9 天前在你的网站上将一件夹克保存到了愿望清单中。今天早上,它的价格下降了 30%。你应该告知他们吗?
这取决于你的目标。如果你希望首次购买者回来进行第二次购买,这条提醒可能有用。如果你要提升生命周期价值,而这位顾客通常支付全价,那么折扣的成本可能超过其收益。无论目标是什么,智能体在做出决定之前,需要关于这一个人的六个答案(图 1)。
图 1。目标框定了一个降价决策,而该决策需要来自六类数据的答案。
如果你正在为 Agentic CDP 准备客户数据,请从这里开始。在 Databricks,我们与许多品牌就此展开合作,而数据模型通常是最困难的部分。本文面向的是设计技术栈的数据架构师,营销人员以及如今的智能体都在该技术栈之上构建。
这是由两部分组成的系列文章的第 1 部分。第 1 部分:建模步骤,从原始数据到全渠道激活。第 2 部分:将 B2C 和 B2B 数据集、属性及用例映射到该模型上。
CDP 数据建模:哪些保持不变,哪些发生变化
智能体式 CDP 需要传统 CDP 所需的一切:正确的数据源、干净的数据、每位客户唯一身份标识,以及营销人员信任的黄金档案。如果你以前构建过 CDP,这些工作可以延续。如果没有,这里就是起点。
变化在于由谁来完成工作,以及数据必须多快达到准确。智能体承担更多工作,例如匹配记录和草拟受众,而人类负责选择数据源、审查匹配结果并批准对外发送的内容。而且,由于智能体会在几秒内为单个人做出决策,数据中的缺口也会以同样快的速度变成糟糕的决策。
这对你的数据模型意味着什么
按计划刷新的分群
按需为单个人做出的决策
每个属性都解析为每个人对应的一个可信值
每晚在工具内进行匹配
有归属、可解释且可逆
一个可审计的身份图谱,带有持久 ID
深度历史记录,加上当下正在发生的情况
批处理数据和事件数据以同一 ID 为键
由人工审核名单
由人制定规则,智能体在每次行动前检查
同意、抑制和业务定义以数据形式存储
营销活动后的报告
团队和智能体根据衡量结果每日调整
互动与成效连同留出对照组一起回落到湖仓中。
Databricks 围绕同样的思路构建了 CustomerLake。数据团队可以通过 Databricks 和 Unity Catalog 一次性定义可信数据集和模型。营销人员随后可以使用专用界面提问、构建分群,并更快地激活受众,无需绕过 IT,也无需把数据导出到不受管理的工具中。
架构:从原始数据到每个渠道的六个步骤
以下是我们推荐的流程。这是一种奖章(medallion)架构,其中有一条重要规则:身份解析在银层之后运行,它生成的规范 ID 成为金层的连接键。
将原始数据落到青铜层。与营销团队就每个用例所需的数据源达成一致,然后将其接入:应用和数据库用 Lakeflow Connect,事件流用 Zerobus Ingest,合作伙伴表则通过 OpenSharing 就地读取。这一步由人来负责:必须有人选择每个数据源,并授权每个连接。保持青铜层原始且仅追加,以便回放历史数据。
在银层清洗:对邮箱、电话和地址做规范化,把时间戳统一为 UTC,把事件归入同一 schema 并去重。身份匹配留到下一步。
在银层之后于一处集中完成身份解析,并在新记录到达时重新运行。结果是为每个人生成一个规范 ID(canonical_id),并建立从每个来源 ID 到该 ID 的映射表(crosswalk)。智能体可以执行匹配,由人来复核。
基于规范 ID 构建金层:一张客户表、1:1 属性表和 1:多 行为表。
添加衍生属性和机器学习。在 gold 层计算衍生属性,并运行倾向性、下一步最佳行动等模型打分,然后按计划把结果写回为一对一属性表。
跨渠道激活,并形成闭环。基于 gold 层数据构建受众,并同步到你使用的各个渠道。CustomerLake Campaign Agents 可帮助营销人员用自然语言构建受众(由 Genie 驱动),也可以在专门构建的 UI 中完成。再把响应和互动指标作为新数据写回 bronze 层。
你用 Spark Declarative Pipelines 构建各层,用 Lakeflow Jobs 让它们按计划运行,并在 Unity Catalog 中治理每一层。
图 2。从原始数据到各打通渠道的一条受治理路径,以一个规范 ID 作为键。
多年来,品牌一直在问:为什么他们不能拥有自己的身份图谱,并在自己的数据上运行确定性匹配?通常的答案是维护成本:规则、重跑和复核都需要人和时间。当身份解析就在数据旁边运行时,拥有图谱就变得可行了,而根据我们的经验,这将是你要构建的最重要的一张表。
图 3。四条源记录解析为同一个人。id_graph 保留了每条关联背后的规则与置信度。
先运行确定性规则(精确邮箱、精确电话、可映射到你的客户 ID 的合作伙伴 ID),然后用概率匹配对空缺部分打分。接着对匹配结果进行聚类,并生成(或保留)一个持久 ID。
让 ID 保持持久。不要从某一个可变的源键派生它,并记录合并与拆分,以便下游系统能够跟进。
明确决定存活规则。为每个属性选定哪个来源胜出(最新、最可信、最完整),并把规则写下来。
优先为精确率做调优。共享的家庭邮箱、共享设备和公司地址会导致错误合并,而一次错误合并就会让你把一个人的优惠发给另一个人。
让人留在流程中。每次发布前抽查一部分匹配结果,并让数据管理员修正错误的匹配。
你可以用 SQL 规则加上 Splink 或 Zingg 之类的开源匹配工具来构建这套方案。也可以使用 CustomerLake:Profile Agents 承担匹配和黄金记录存活规则的重活。这种方案被称为 Agentic Identity Resolution,它结合确定性匹配、概率匹配和基于 LLM 的匹配来连接碎片化的记录。人工数据管理员覆盖机制让团队可以在需要时施加人工判断。
把黄金层建模为实体、属性表和行为表
图 4。直接使用属性列;先对行为表做聚合或过滤。
客户表(实体)。每个 canonical_id 一行,包含你用于激活的所有标识符:邮箱、电话、地址、App 用户、设备、忠诚度计划和 CRM ID。在 B2B 场景中,实体是账户和联系人。
属性表(1:1)。可以使用多张,每张每个 canonical_id 一行:一两张用于倾向性评分和下一步最佳行动这类模型输出,一张用于各渠道的同意授权,一张用于 recency、生命周期阶段等其他派生属性。拆分成独立的表后,每个负责方可以按自己的节奏刷新。
行为表(一对多)。订单、Web 和 App 事件、互动和服务案例,每个事件一行并带有时间戳。保持这种粒度,因为营销人员正是在 Campaign Agents 中基于此创建自己的属性,例如过去 30 天的订单。
将完整的同意历史记录(每个人、渠道、目的、来源和时间各一行)以及抑制名单(如退订和退信)保留在 silver 层。从这些记录中派生 1:1 同意表,以便受众和智能体在发送前检查同一处。
标记每个表:批处理或事件
为每个 gold 表打标,以便活动构建者了解其新鲜程度:
客户表、属性表
随事件到达增量更新,每个事件一行并带时间戳
Web 和 App 事件、购物车、交易
会话内决策、过滤器和触发器
在 Spark Declarative Pipelines 中将事件表构建为流式表,并将该标志记录为 Unity Catalog 标签。流式表可以按计划或连续更新;对于购物车提醒之类的触发器,以连续模式运行其管道,这样“在新数据到达时让表保持最新”。仅按计划到达的行为(例如每晚的门店销售)保持为批处理,直到你将其流式化。如果事件携带规范 ID,那么之后再添加触发器应该不需要重新建模。
另外两个习惯也有帮助:依据声明的 as-of 日期计算时间窗口,这样重跑会得到相同的答案;并保留一份受治理的副本,只向每个激活工具提供其所需的表。
全渠道激活与反馈闭环
原文较长,译文为节选;译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。
查看英文原文(Data Modeling Best Practices for an Agentic CDP, Part 1: The Data Foundation)
Resolve identity once, after silver, then build gold on one canonical ID. In a medallion architecture, raw data lands in bronze and gets cleaned in silver. Identity resolution then creates a persistent canonical_id, and the gold layer is built from a customer table, 1:1 attribute tables and 1:many behavior tables.
Flag every gold table as batch or event, and land responses back as data. Event tables built as streaming tables, plus engagement and outcomes stored with holdouts, mean you can add trigger-based campaigns and closed-loop measurement later without a remodel.
A customer saved a jacket to their wishlist on your site 9 days ago. This morning its price dropped 30%. Should you let them know?
That depends on your goal. If you want first-time buyers to come back for a second purchase, the alert could help. If you're growing lifetime value and this customer usually pays full price, the discount may cost more than it earns. Whatever the goal, an agent needs six answers about this one person before it makes the call (Figure 1).

Figure 1. The goal frames one price-drop decision, and the decision needs answers from six kinds of data.
If you're getting customer data ready for an Agentic CDP, start here. At Databricks, we work with many brands on this, and the data model is usually the hardest part. This post is for the data architect who designs the stack that marketers, and now agents, build on.
This is Part 1 of a two-part series. Part 1: the modeling steps, from raw data to omnichannel activation. Part 2: mapping B2C and B2B datasets, attributes and use cases onto the model.
CDP data modeling: What stays the same, and what changes
An Agentic CDP needs everything a traditional CDP needs: the right sources, clean data, one identity per customer and golden profiles marketers trust. If you've built a CDP before, that work carries over. If you haven't, it's the place to start.
What changes is who does the work and how fast the data has to be right. Agents take on more of the work, such as matching records and drafting audiences, while people choose the sources, review the matches and approve what goes out. And because an agent decides for one person in seconds, a gap in the data turns into a bad decision just as fast.
What it means for your data model
A segment, refreshed on a schedule
A decision for one person, on demand
Each attribute resolves to one trustworthy value per person
Matched nightly inside a tool
Owned, explainable and reversible
An identity graph you can audit, with a persistent ID
Deep history plus what's happening now
Batch and event data keyed to the same ID
A human reviews the list
Rules people set and agents check before each action
Consent, suppression and business definitions stored as data
A report after the campaign
Teams and agents adjust daily from measured results
Engagement and outcomes land back in the lakehouse, with holdouts
Databricks built CustomerLake around the same idea. Data teams can define trusted datasets and models once through Databricks and Unity Catalog. Marketers can then use purpose-built interfaces to ask questions, build segments, and activate audiences faster without working around IT or exporting data into unmanaged tools.
The architecture: six steps from raw data to every channel
Here's the flow we recommend. It's a medallion architecture with one important rule: identity resolution runs after silver, and the canonical ID it creates becomes the join key for gold.
Land raw data in bronze. Agree with your marketing team on the sources each use case needs, then connect them: apps and databases with Lakeflow Connect, event streams with Zerobus Ingest, and partner tables read in place with OpenSharing. People own this step: someone has to choose each source and authorize each connection. Keep bronze raw and append-only, so you can replay history.
Clean in silver. Normalize emails, phones and addresses, put timestamps in UTC, put events on one schema and remove duplicates. Leave identity matching for the next step.
Resolve identity after silver, in one place, and rerun it as new records arrive. The result is one canonical ID (canonical_id) per person and a crosswalk from every source ID. Agents can do the matching, and people review it.
Build the gold layer on the canonical ID: a customer table, 1:1 attribute tables and 1:many behavior tables.
Add derived attributes and ML. Compute derived attributes and score models such as propensity and next best action on gold, then write the results back as 1:1 attribute tables on a schedule.
Activate across channels, and close the loop. Build audiences on gold-layer data and sync them to the channels you use. CustomerLake Campaign Agents helps marketers build audiences in natural language, powered by Genie, or in the purpose-built UI. Land the responses and engagement metrics back in bronze as new data.
You build the layers with Spark Declarative Pipelines, keep them on schedule with Lakeflow Jobs and govern every layer in Unity Catalog.
Figure 2. One governed path from raw data to connected channels, keyed by one canonical ID.
Brands have asked for years why they can't own their identity graph and run deterministic matching on their own data. The usual answer was upkeep: the rules, reruns and reviews take people and time. With identity resolution running next to the data, owning the graph becomes practical, and in our experience it's the most important table you'll build.
Figure 3. Four source records resolve to one person. The id_graph keeps the rule and confidence behind each link.
Run deterministic rules first (exact email, exact phone, a partner ID that maps to your customer ID), then score the gaps with probabilistic matching. Then cluster the matches and mint, or keep, a persistent ID.
Keep the ID persistent. Don't derive it from one mutable source key, and record merges and splits so downstream systems can follow.
Decide survivorship explicitly. Pick which source wins for each attribute (most recent, most trusted, most complete) and write the rule down.
Tune for precision first. Shared family emails, shared devices and business addresses cause false merges, and with a false merge you send one person's offer to someone else.
Keep people in the loop. Review a sample of matches before each publish, and let data stewards fix the wrong ones.
You can build this with SQL rules plus an open-source matcher such as Splink or Zingg. Or use CustomerLake: Profile Agents handle the heavy lifting of matching and golden-record survivorship. The approach is called Agentic Identity Resolution, which combines deterministic, probabilistic, and LLM-based matching to connect fragmented records. Manual data steward overrides allow teams to apply human judgment where needed.
Model the gold layer as an entity, attribute tables, and behavior tables
Figure 4. Use attribute columns directly; aggregate or filter behavior tables first.
Customer table (the entity). One row per canonical_id, with every identifier you activate on: email, phone, address, app user, device, loyalty and CRM IDs. In B2B, accounts and contacts are the entities.
Attribute tables (1:1). Use several, each with one row per canonical_id: one or two for model outputs such as propensity scores and next best action, one for consent on every channel, and one for other derived attributes such as recency and lifecycle stage. Separate tables let each owner refresh on their own schedule.
Behavior tables (1:many). Orders, web and app events, engagement and service cases, with one row per event and a timestamp. Keep that grain, because that's where marketers create their own attributes in Campaign Agents, such as orders in the last 30 days.
Keep the full consent history (one row per person, channel, purpose, source and time) and the suppressions, such as unsubscribes and bounces, in silver. Derive the 1:1 consent table from them, so audiences and agents check one place before they send.
Flag every table: batch or event
Flag each gold table so campaign builders know how fresh it is:
customer, attribute tables
Updated incrementally as events arrive, one row per event with a timestamp
Web and app events, cart, transactions
In-session decisions, filters and triggers
Build event tables as streaming tables in Spark Declarative Pipelines and record the flag as a Unity Catalog tag. Streaming tables can update on a schedule or continuously; for triggers like a cart reminder, run their pipelines in continuous mode, which "keeps tables fresh as new data arrives." Behavior that arrives only on a schedule, such as nightly store sales, stays Batch until you stream it. If the events carry the canonical ID, adding triggers later shouldn't need a remodel.
Two more habits help: compute time windows against a declared as-of date, so a rerun gives the same answer, and keep one governed copy, giving each activation tool only the tables it needs.
Omnichannel activation and the feedback loop
With the model in place, you define an audience or a decision once, on governed gold tables, and send it to the channels your customers use.
Figure 5. Decide once on governed data, activate across channels, and land responses back as data.
Pick the right shape for each channel. Batch audiences suit email, paid media and direct mail; in CustomerLake, a scheduled sync can refresh them as often as every 1 minute. Event-triggered decisions suit cart recovery, back-in-stock and in-app moments. Low-latency lookups from Lakebase suit web personalization, contact centers and agents that need a profile mid-conversation.
Send the payload with the audience. A personalized message needs attribute columns, such as the next best action and the offer, so sync them with the IDs.
Close the loop. Land sends, opens, clicks, visits and purchases in bronze, key them to the same canonical_id, and compare outcomes with a holdout group in each channel.
CustomerLake enables direct syncing of audiences and signals to martech, adtech and CX channels directly with native Reverse ETL connectors, without custom pipelines or additional activation layers.
A data foundation checklist
If you can say yes to most of these, your foundation is ready for agents:
Your marketing and data teams agree on the decisions to support and the sources each one needs.
Identity resolution runs in one place, after silver, with incremental reruns and human review, and publishes a persistent canonical_id with an auditable id_graph.
Gold has a customer table with every identifier, 1:1 attribute tables for model scores, consent and derived attributes, and behavior tables at event grain.
Every gold table carries the canonical ID or a natural key and a batch or event flag, and event tables are streaming tables.
Engagement and outcomes land back in bronze with holdout groups, and partner data is read in place.
Govern and serve: Unity Catalog, Lakebase
Activate with CustomerLake: Learn more about CustomerLake and contact your Databricks account team for access.
The foundation is in place. In Part 2, we put it to work:
How marketers, data teams and agents share the same gold tables, and how to describe data so every team reads it the same way.
B2C and B2B datasets side by side, and the keys that join them.
Attributes worth building first, including ML scores, and the use cases you can launch in weeks, starting with paid media suppression.
We'll come back to the jacket use case in the beginning, and show which datasets answer each of the six questions.
1. What is the best data model for an Agentic CDP?
A medallion architecture where identity resolution runs after silver and its canonical ID becomes the join key for gold. The gold layer has three kinds of tables: a customer table with every activation identifier, 1:1 attribute tables for model scores, consent and derived attributes, and 1:many behavior tables, such as orders and events, at event grain.
2. Where should identity resolution run in a CDP data pipeline?
Identity resolution should run in one place, after data is cleaned in silver and before the gold layer is built. Running it on normalized emails, phones and addresses gives more accurate matches. It should rerun as new records arrive and publish a persistent canonical_id plus an auditable identity graph that records the rule and confidence behind each link.
3. Why should brands own their identity graph?
An owned identity graph is explainable, auditable and reversible, and agents need that to make decisions for one person safely. Brands can run deterministic rules first, score the gaps with probabilistic matching, and record merges and splits so downstream systems can follow. With identity resolution running next to the data, keeping the graph up to date is now practical.
4. What is the difference between attribute tables and behavior tables in a CDP?
Attribute tables have one row per customer, holding values like propensity scores, consent status or lifecycle stage. Behavior tables have many rows per customer, one per event with a timestamp, such as orders, web visits or service cases. Marketers use attribute columns directly and aggregate behavior tables into new attributes, such as "orders in the last 30 days."
5. How do you prepare a CDP data model for real-time, trigger-based campaigns?
Flag each gold table as batch or event, and build event tables as streaming tables keyed to the canonical ID. For triggers like cart recovery, run those pipelines in continuous mode. If events already carry the canonical ID, you can add triggers later without remodeling. Landing responses back in the lakehouse then closes the measurement loop.
Get the latest posts in your inbox
原文为英文,正文由自动抓取并保留原文。
原文发布于 Databricks Blog(Data Modeling Best Practices for an Agentic CDP, Part 1: The Data Foundation),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。