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.