Platform
PBCP / Intelligence
Overview

Intelligence (inside PBCP)

API Base: https://pbcp-api.pcampus.co/v1/intelligence
Recommendations: https://pbcp-api.pcampus.co/v1/recommendations

Overview

Intelligence lives inside PBCP. It is not sold separately. Enabling PBCP includes this recommendation layer.

PBCP Intelligence is the analytics and recommendation layer that sits on top of Business Context and transforms context into actionable insights — answering the questions business owners actually need:

  • Who is about to churn? → Send a win-back coupon
  • Which segment responds best to this campaign? → Target that group specifically
  • What should this customer receive next? → A personalized offer tailored to them

Boundary: Intelligence analyzes and recommends — it does not send LINE, email, or push messages itself. Execution lives in the customer app (e.g., Pharmacy App)

Position in PBCP stack

Intelligence reads from the Context API only — it never queries the Event Store directly.

Four intelligence pillars

1. Customer Intelligence

Analyzes individual customers:

SignalWhat it answers
Purchase frequencyHow often this customer buys
Average basket sizeAverage spend per transaction
Category affinityPreferred product category
Churn risk scoreProbability of churning (0–1)
Lifetime valueCumulative value over the customer's lifetime

2. Segment Intelligence

Automatically segments customers based on behavior:

SegmentCharacteristics
ChampionsFrequent buyers, high value, recent
LoyalConsistent buyers, but basket size is smaller
At RiskWere good customers but have stopped buying for a while
LostHave not bought for a very long time
NewMade their first purchase recently
High ValueLarge basket but infrequent buyers

Segments use the RFM model (Recency · Frequency · Monetary) as a baseline — weights are adjustable per domain

3. Campaign Intelligence

Measures and compares campaigns:

MetricMeaning
Response rate% of customers who take action after receiving an offer
Revenue upliftRevenue increase compared to baseline
Segment fitWhich segment this campaign works for
Coupon redemption% of coupons actually used
CannibalizationWhether the offer reduces full-price sales

4. Journey Intelligence

Analyzes funnels and paths:

  • Where most customers drop off
  • What path leads to the fastest purchase
  • What behavior distinguishes sessions that convert

5. Evaluation Intelligence

Measures outcomes and learns from actual actions — making Intelligence smarter with every cycle.

AI Quality Metrics:

SignalData Obtained
suggestion.acceptedAI suggestion was accurate enough for admin to use as-is
suggestion.edited + edit distanceHow much was edited → accuracy score
suggestion.dismissedAI miss — must update the Q&A corpus
chatbot.resolved vs chatbot.escalatedChatbot resolution rate per topic

Human Quality Metrics:

MetricMeaning
First response timeHow quickly admin responds to customers
Resolution timeHow many minutes to close a conversation
CSAT scoreCustomer satisfaction rating (1–5)
Suggestion usage rateUsing AI vs. typing manually

Outcome Attribution:

ActionOutcome Measured
Send coupon via ConnectDoes the customer use the coupon within N days?
Send LINE Flex Messageopen → click → conversion?
Send email digestopen rate, click rate, re-purchase?
Reduce churn risk predictionDoes the customer remain within 30 days?

Every signal combines into (context → action → outcome) tuples — stored in the Evaluation Store and fed back into Intelligence to refine scoring and recommendations.


Recommendation Engine

The core of Intelligence — takes all insights and converts them into structured recommendations that the customer app can use immediately.

Individual Recommendations

Output Example:

{
  "customerId": "cust_xxx",
  "segment": "at_risk",
  "churnRisk": 0.78,
  "recommendations": [
    {
      "type": "coupon",
      "reason": "high_churn_risk",
      "offer": "10% off next purchase",
      "targetCategory": "vitamins",
      "confidence": 0.82,
      "validDays": 7
    },
    {
      "type": "reward",
      "reason": "loyalty_recognition",
      "offer": "bonus points x2",
      "confidence": 0.74
    }
  ]
}

Segment Recommendations

Output Example:

{
  "segment": "at_risk",
  "audienceSize": 142,
  "recommendations": [
    {
      "type": "campaign",
      "name": "comeback_offer",
      "description": "ส่งคูปอง 15% สำหรับลูกค้าที่ไม่ซื้อ 45+ วัน",
      "expectedResponseRate": 0.24,
      "expectedRevenueLift": 18500,
      "suggestedChannels": ["line_oa", "sms"]
    }
  ]
}

Full data flow

Pilot — Pharmacy (Pharmacy)

Use caseWhat Intelligence DoesExecution
Patients on continuous medication who haven't returnedChurn risk → recommend couponPharmacy sends LINE OA
Elderly patient groupSegment → recommend vitamin campaignPharmacy broadcasts SMS
Which promotion performs bestCampaign intelligence → ROI reportDisplayed in Pulse
New customer makes first purchaseNew segment → onboarding rewardPharmacy sends push notification

API overview

MethodEndpointDescription
GET/v1/intelligence/customers/:idCustomer intelligence profile
GET/v1/intelligence/segmentsList auto-generated segments + sizes
GET/v1/intelligence/segments/:segmentSegment intelligence detail
GET/v1/intelligence/campaigns/:idCampaign intelligence report
GET/v1/intelligence/journey/funnelFunnel analysis
GET/v1/intelligence/journey/pathsCommon paths to purchase
GET/v1/recommendations/customers/:idRecommendations for individual
POST/v1/recommendations/segmentsRecommendations for segment + goal
GET/v1/recommendations/stubStub response (dev/demo mode)
GET/metrics/business-pulseBusiness pulse summary (24h / 30d)
POST/v1/evaluation/signalsRecord an evaluation signal (suggestion decision, outcome)
GET/v1/evaluation/ai-qualityAI suggestion quality metrics (acceptance rate, edit distance)
GET/v1/evaluation/staff/:staffIdStaff performance metrics (response time, CSAT, resolution rate)
GET/v1/evaluation/outcomesOutcome attribution — conversion rate per action type
⚠️

Intelligence API lives inside PBCP Core — it is not a separate service deployment