SocialHub.AI

Developer Center · Engineering reference

Consumer World Model

The model layer under the Decide node: a per-brand Behavior Model (an event-sequence model of how each member behaves) plus a Digital Twin layer that runs it forward (counterfactual simulation and the synthetic research panel). This page covers what an integrator can actually touch: the events that feed it, the gate that decides whether it serves, the surfaces its outputs land on, and the MCP tools that drive the panel.

Use the governed read-only REST endpoints or MCP tools below for one member prediction. Next-behavior results and personal purchase windows share a response, with explicit availability and permission checks. Events still enter through the normal integration surfaces; additional outputs surface in segments, member profiles, lookalike, send-time optimization and the synthetic panel.

下一行为、购买窗口与整体需求趋势

一次会员预测同时返回下一行为与个人购买窗口;品牌融合头可用时,将个人信号与整体需求趋势结合。

交互示例

一个消费者,一份统一预测。

所有状态与数值均为合成示例,不代表实时预测或工作区可用状态;不会发送客户数据。

选择示例状态
部分可用

已有行为预测仍可返回。品牌融合头完成训练并通过验证前,个人购买窗口保持不可用。

下一步可能做什么?

一份最终分布,覆盖本示例的4个支持事件;下一行为概率尚未经校准。

下一事件概率
购买37%
访问会员门户28%
点击邮件21%
核销优惠券14%
为什么有些事件没有概率?

“发送邮件”属于输入上下文,不是预测目标,因此概率为 null。不支持或没有数据覆盖的事件同样保持不可用。

未来多久内可能购买?

CWM 个人信号 + TimesFM 品牌需求趋势。

7 天内
不可用
30 天内
不可用
90 天内
不可用

预测窗口内至少购买一次的累计概率。三个窗口之间、窗口与行为分布之间均不能相加。

把同一份结果接入工作流程

一次会员请求同时返回 distribution 与 purchaseWindows。

查看 API / MCP 调用
curl --request GET \
  "https://YOUR_API_HOST/api/v2/cwm/members/YOUR_MEMBER_UUID/next-behaviors" \
  --header "Authorization: Bearer YOUR_API_KEY"

请替换 API 域名、会员 UUID 与工作区 API 密钥。

所需权限 · predictions:read 可读取行为;额外授予 metrics:read(或 *)后,可在模型就绪时获取购买窗口。

查看响应节选

仅为合成示例节选。品牌模型响应还包含完整事件目录及覆盖信息;公共先验参考采用独立的6类词表。

{
  "predictionKind": "next_event",
  "unit": "probability_0_1",
  "status": "degraded",
  "distribution": {
    "status": "ok",
    "vocabulary": "member_event",
    "normalization": "conditional_on_supported_events",
    "calibrated": false,
    "rows": [
      {
        "key": "purchase.completed",
        "label": "Purchase",
        "probability": 0.37,
        "rank": 1,
        "availability": "predicted"
      },
      {
        "key": "portal.visited",
        "label": "Portal visit",
        "probability": 0.28,
        "rank": 2,
        "availability": "predicted"
      },
      {
        "key": "email.clicked",
        "label": "Email clicked",
        "probability": 0.21,
        "rank": 3,
        "availability": "predicted"
      },
      {
        "key": "coupon.redeemed",
        "label": "Coupon redeemed",
        "probability": 0.14,
        "rank": 4,
        "availability": "predicted"
      },
      {
        "key": "email.sent",
        "label": "Email sent",
        "probability": null,
        "rank": null,
        "availability": "context_only"
      }
    ]
  },
  "purchaseWindows": {
    "unit": "probability_0_1",
    "probabilities": {
      "7": null,
      "30": null,
      "90": null
    },
    "calibrated": false,
    "envelope": {
      "status": "unavailable",
      "backend": "cwm-timesfm-2.5",
      "reasonCodes": [
        "fusion_not_trained"
      ]
    }
  },
  "reasonCodes": [
    "fusion_not_trained"
  ]
}

合成数据 · TimesFM 2.5

探索逐日需求趋势

基于128天合成历史生成的预测示例,对比近期需求走势、未来逐日预测和分位数范围。

预测窗口

合成需求单位

近期日均需求
20.0
预测日均需求
20.1
预测累计需求
604.3
历史 · 最近28天预测值
历史需求、未来逐日预测和q10–q90分位范围深蓝线为最近28天历史,绿线为所选窗口的预测,阴影为q10–q90分位范围。可通过日期滑块查看每天的预测。
第 1天 · 2026-10-05
预测值
22.9
q10
22.8
q90
23.0
查看每日预测数据
日期(UTC)预测值q10–q90
2026-10-0522.922.8–23.0
2026-10-0621.321.2–21.4
2026-10-0718.718.6–18.8
2026-10-0817.117.0–17.1
2026-10-0917.717.6–17.7
2026-10-1020.020.0–20.1
2026-10-1122.322.3–22.4
2026-10-1222.922.9–22.9
2026-10-1321.321.2–21.3
2026-10-1418.718.6–18.7
2026-10-1517.117.0–17.2
2026-10-1617.717.6–17.7
2026-10-1720.019.9–20.1
2026-10-1822.422.3–22.4
2026-10-1922.922.8–23.0
2026-10-2021.321.2–21.4
2026-10-2118.718.6–18.7
2026-10-2217.117.0–17.1
2026-10-2317.717.6–17.7
2026-10-2420.019.9–20.0
2026-10-2522.322.3–22.4
2026-10-2622.922.8–22.9
2026-10-2721.321.2–21.3
2026-10-2818.718.6–18.7
2026-10-2917.117.0–17.2
2026-10-3017.717.6–17.7
2026-10-3120.020.0–20.1
2026-11-0122.422.3–22.4
2026-11-0222.922.8–22.9
2026-11-0321.321.2–21.3
下载示例数据(JSON) ↓

本示例输入为合成数据,预测由真实TimesFM 2.5权重生成。预测起点为2026-10-05(UTC),演示日期固定;分位数覆盖率尚未经校准。数值不代表客户实际需求或个人购买概率。

一份完整的下一行为概率

一次获得一份最终概率分布与排序。通过评测的品牌模型优先,最多支持23类有数据覆盖的目标;品牌模型不可用时,内部公共先验模型汇总成一份6类参考分布。不支持及仅作上下文的事件保持不可用。

7 / 30 / 90天购买窗口

自动包含在同一份会员响应中:租户独立的轻量融合头结合 CWM 信号与 TimesFM 品牌趋势。合格融合头直接输出;缺少训练或评测时,购买窗口保持不可用,已有行为预测仍可返回。

品牌与品类的逐日预测

TimesFM 2.5 服务已配置且逐日历史完整时,可预测未来最多90天的销售额、订单数或商品销量,并提供预测值和9个分位数。

如何理解这些结果

下一行为概率在支持的候选类别中合计为100%,尚未经校准。购买窗口单独预测7/30/90天内至少购买一次的累计概率,不与行为类别一起归一化。行为分布未按静默时长调整;公共先验参考尚未通过工作区验证。

需求分位数表达整体不确定性,不是个人购买区间,覆盖率尚未经校准。缺失数据保持不可用;在工作区评测完成前,不宣称精度提升。

集成细节与可用条件
# Bearer API key; predictions:read
GET /api/v2/cwm/capabilities
GET /api/v2/cwm/members/{id}/next-behaviors

# metrics:read additionally enables purchaseWindows in next-behaviors
# predictions:read AND metrics:read for standalone trend/windows
GET /api/v2/cwm/trends?metric=gmv&horizon_days=30
GET /api/v2/cwm/members/{id}/purchase-windows

# Read-only MCP equivalents
cwm_get_forecast_capabilities
cwm_predict_next_behaviors
cwm_forecast_aggregate_trend
cwm_predict_purchase_windows

Purchase probabilities use 0–1 units and cumulative, monotonic windows. Until trained and validated, the response contains probabilities: {"7":null,"30":null,"90":null} and calibrated: false. Existing CWM 0–100 mass scores keep their meaning. Aggregate forecasts return one point and q10..q90 per complete UTC day; missing daily buckets are not filled with zero. Category names require catalog_gmv or units_sold; draft input metrics are disclosed. Tenant and member authorization remain server-side. Readiness distinguishes service_unavailable, awaiting_training, awaiting_validation and ready. TimesFM 2.5 weights use Apache 2.0.

Next-behavior responses use predictionKind: next_event and unit: probability_0_1. One response includes distribution and purchaseWindows; individual expert results are internal. Purchase fusion is invoked automatically when metrics access permits. A validated tenant head serves cumulative 7/30/90-day probabilities; missing permission, training, validation or inputs leaves all windows null with an explicit reason. Available behavior predictions remain readable. These windows are not summed with the next-event distribution. The brand model's rows include all 48 standard events: 26 are consumer behaviors, 39 enter the sequence vocabulary, and 23 is the prediction-target ceiling. Only covered candidates supported by the active, evaluated generation receive probabilities; all other rows have probability: null and an explicit availability. Legacy input-frequency coverage is weaker corpus-presence evidence and cannot certify provenance-masked tag targets. New snapshots use positive targets from optimizer training windows, excluding validation members and masked rows. The final distribution includes rank, entropyBits, retainedModelMass, coverageBasis, modelVersion and calibrated: false. An available, evaluated brand model is used directly without requesting alternate expert outputs. Otherwise, valid public-prior distributions are equally averaged internally into one degraded pv / fav / cart / buy / rmcart / buy_disc reference. aggregation distinguishes single_tenant_model from uniform_valid_experts; vocabulary identifies the candidate key space. The two vocabularies are never blended. The uniform reference is not a learned multiclass gate and is not tenant-validated; public class-training coverage is unverified. Rounded zero mass does not prove absent class training. This endpoint needs predictions:read; purchaseWindows additionally needs metrics:read or *. Without metrics permission, the purchase component reports metrics_scope_required and makes no metric or fusion call. Status is ok only when both earned components serve, degraded for partial/reference results, and unavailable when neither serves. Store access and live processing eligibility are rechecked before personal external processing; insufficient evidence remains unavailable. One request shares its live CWM fingerprint internally across the behavior and purchase heads.

1 · What feeds it

The model trains on the member event stream your integrations already produce — REST API v2 (orders, members), web & portal tracking, POS/receipt capture, loyalty and coupon activity. Events pass a governed catalog with a policy firewall before they can enter training; the firewall is enforced in the pipeline, not by convention.

Admitted: behavioral events

Purchases, receipts, points earned/redeemed, tier changes, coupon claims/redemptions, email opens/clicks, push opens, portal visits/clicks, store check-ins. Every event type is explicitly admitted to the catalog — new event types don't train silently.

Barred: feedback & content

Anything the model itself writes back (its own tags and scores) is excluded — a model must not learn from its own output. Message content and free text never enter training: the model learns that a member clicked, never what the message said.

Barred: restricted members

Members under a processing restriction (GDPR Art. 18) are excluded from training end-to-end, and an erased member's data — including their embedding — is removed as part of the deletion machinery itself.

Practical consequence for integrators: the richer and cleaner your event feed (correct member identity resolution, honest timestamps), the better the model — there is no separate “training upload.” See REST API and Web Tracking.

2 · The honesty gate & serving predicate

A brand's model is trained per tenant, deterministically (same data ⇒ same model, versioned), and it only serves after beating a transparent baseline on that brand's own held-out data. Downstream consumers never read the model directly — they go through a single serving predicate:

serve = verified_win ∧ not_paused ∧ not_stale

If any leg fails — the model hasn't earned its place yet, the brand paused scoring, or the model has gone stale — every consumer falls back to the glass-box predictive models (or an honest empty state, in lookalike's case). Nothing is ever zero-filled and nothing pretends: a member without an embedding is served by the fallback path, never padded into the model's.

Lifecycle a brand sees

Accumulating data

not enough history to train honestly — nothing serves

Comparing weekly

trained, being tested against the baseline on held-out reality

Active

beat the baseline — embeddings & predictions serve

Paused / stale

scoring stops or the model ages out — automatic fallback

3 · Outputs and where they surface

Three existing output families are available in the member and segment surfaces below. Use the governed REST or MCP prediction interface above for the unified next-event distribution and purchase windows.

Member embeddings

A behavioral fingerprint per member, learned from their whole event sequence. Powers nearest-neighbor similarity: every member with behavior has one — no tags required.

Next-event probabilities

Per-member purchase imminence and churn imminence (0–100), refreshed as behavior lands. Exposed as segment conditions — e.g. "Purchase Imminence (predicted next-event, 0-100)" — and on the member profile.

Per-member timing

Each member's expected next-purchase window and engaged hour of day, from their own rhythm.

4 · Driving the synthetic panel over MCP

Your AI agents can operate the Digital Twin's research panel through the governed MCP server. Four panel tools, verbatim from the live manifest, alongside the read-only prediction tools above:

list_synthetic_scenarios

((none))

List the synthetic-panel simulation scenarios with each one's honest usability boundary, confidence ceiling, and input fields. Call first to pick a kind. Requires metrics:read.

run_synthetic_panel

(segment_id, kind, fields)

Run a synthetic panel: de-identified digital twins of a segment react to a stimulus, producing an honest directional report (never real absolute numbers). Returns a run_id to poll. Bounded by a daily run cap + ≤50 twins. Requires synthetic:write.

get_synthetic_report

(run_id)

Read the frozen honest report for a synthetic-panel run — directional read, confidence ceiling, suppression flags, themes — or a blockReason if not ready. Requires metrics:read.

get_synthetic_calibration

((none))

The brand's synthetic-panel calibration (hit rate of past synthetic predictions vs reality; null until backtests exist). Requires metrics:read.

Typical flow

  1. 1. list_synthetic_scenarios → pick a kind + read its usability boundary
  2. 2. run_synthetic_panel(segment_id, kind, fields) → run_id // requires synthetic:write
  3. 3. get_synthetic_report(run_id) → directional read · confidence ceiling · suppression · themes — or blockReason
  4. 4. get_synthetic_calibration() → your brand's hit rate vs. reality (null until backtests exist)

Contract to design against: runs are bounded (daily run cap, ≤50 twins per run); reports are directional, never absolute numbers; a run that fails its honesty checks (panel collapse, sycophancy, too-small sample) comes back with a blockReason or suppression flags instead of a flattering result — treat those as terminal, not retryable. The same caps and rules apply whether a human or your agent starts the run. Setup, auth and scopes: MCP Integration Guide.

5 · Guarantees you can build on

Per-brand isolation

One model per tenant, trained on that tenant's members only. Nothing pools across brands — in either direction.

Deterministic & versioned

Same data produces the same model, bit for bit; every score is traceable to the model version that produced it.

Erasure-complete

Member erasure deletes their training data and embedding as part of the deletion transaction — not on a cleanup schedule.

Staleness-purged

Embeddings that outlive their freshness window are purged on schedule, and a stale model stops serving automatically.