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 อยู่ใน PBCP — ไม่แยกขาย ไม่มี SKU ของตัวเอง เปิด PBCP แล้วได้ชั้นแนะนำนี้ด้วย

PBCP Intelligence คือ analytics and recommendation layer ที่นั่งอยู่บน Business Context และเปลี่ยน context ให้กลายเป็น actionable insights — ตอบคำถามที่เจ้าของธุรกิจต้องการจริงๆ:

  • ใครกำลังจะหายไป? → ส่งคูปองดึงกลับ
  • กลุ่มไหนตอบสนอง campaign นี้ดีที่สุด? → target เฉพาะกลุ่มนั้น
  • ลูกค้าคนนี้ควรได้รับอะไรต่อไป? → personalized offer รายบุคคล

Boundary: Intelligence วิเคราะห์และแนะนำ — ไม่ส่ง LINE, email, push เอง Execution อยู่ใน customer app (เช่น Pharmacy App)

Position in PBCP stack

Intelligence อ่านจาก Context API เท่านั้น — ไม่เคย query Event Store โดยตรง

Four intelligence pillars

1. Customer Intelligence

วิเคราะห์ลูกค้าระดับรายคน:

Signalตอบอะไร
Purchase frequencyลูกค้าคนนี้ซื้อทุกกี่วัน
Average basket sizeใช้จ่ายเฉลี่ยต่อครั้งเท่าไหร่
Category affinityชอบสินค้าประเภทไหน
Churn risk scoreโอกาสที่จะหายไปมากแค่ไหน (0–1)
Lifetime valueมูลค่าสะสมตลอดอายุลูกค้า

2. Segment Intelligence

จัดกลุ่มลูกค้าอัตโนมัติจาก behavior:

Segmentลักษณะ
Championsซื้อบ่อย มูลค่าสูง ล่าสุดไม่นาน
Loyalซื้อสม่ำเสมอ แต่ basket ไม่ใหญ่
At Riskเคยดี แต่หยุดซื้อมาสักพัก
Lostไม่ซื้อมานานมาก
Newซื้อครั้งแรกไม่นาน
High Valuebasket ใหญ่แต่ซื้อไม่บ่อย

Segment ใช้ RFM model (Recency · Frequency · Monetary) เป็น baseline — ปรับ weight ได้ต่อ domain

3. Campaign Intelligence

วัดผลและเปรียบเทียบ campaign:

Metricความหมาย
Response rate% ลูกค้าที่ทำ action หลังได้รับ offer
Revenue upliftรายได้ที่เพิ่มขึ้นเทียบกับ baseline
Segment fitcampaign นี้ work กับกลุ่มไหน
Coupon redemption% คูปองที่ถูกใช้จริง
Cannibalizationoffer ลดยอดขาย full-price หรือเปล่า

4. Journey Intelligence

วิเคราะห์ funnel และ path:

  • ลูกค้าหายไปตรงไหนมากที่สุด
  • path ที่นำไปสู่ purchase ที่เร็วที่สุดคืออะไร
  • session ที่ convert มีพฤติกรรมอะไรที่แตกต่าง

5. Evaluation Intelligence

วัดผลและเรียนรู้จาก action ที่เกิดขึ้นจริง — ทำให้ Intelligence ฉลาดขึ้นในทุกรอบ

AI Quality Metrics:

Signalข้อมูลที่ได้
suggestion.acceptedAI suggestion แม่นพอที่ admin ใช้ได้เลย
suggestion.edited + edit distanceแก้มากแค่ไหน → คะแนน accuracy
suggestion.dismissedAI miss ทิ้ง → ต้องปรับ Q&A corpus
chatbot.resolved vs chatbot.escalatedChatbot resolution rate per topic

Human Quality Metrics:

Metricความหมาย
First response timeadmin ตอบลูกค้าเร็วแค่ไหน
Resolution timeปิด conversation ภายในกี่นาที
CSAT scoreลูกค้า rate ความพึงพอใจ (1–5)
Suggestion usage rateใช้ AI vs. พิมพ์เอง

Outcome Attribution:

ActionOutcome วัด
ส่ง coupon ผ่าน Connectลูกค้าใช้คูปองภายใน N วัน?
ส่ง LINE Flex Messageopen → click → conversion?
ส่ง email digestopen rate, click rate, re-purchase?
ลด churn risk predictionลูกค้ายังอยู่ใน 30 วัน?

ทุก signal รวมกันเป็น (context → action → outcome) tuples — เก็บใน Evaluation Store และ feed กลับเข้า Intelligence เพื่อปรับ scoring และ recommendation


Recommendation Engine

หัวใจของ Intelligence — เอา insights ทั้งหมดมาแปลงเป็น structured recommendations ที่ customer app นำไปใช้ได้ทันที

รายบุคคล (Individual)

Output ตัวอย่าง:

{
  "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)

Output ตัวอย่าง:

{
  "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)

Use caseIntelligence ทำอะไรExecution
คนไข้ที่ใช้ยาต่อเนื่องไม่ได้กลับมาChurn risk → recommend couponPharmacy ส่ง LINE OA
คนไข้กลุ่มผู้สูงอายุSegment → recommend วิตามิน campaignPharmacy broadcast SMS
โปรโมชั่นไหนได้ผลดีสุดCampaign intelligence → ROI reportแสดงใน Pulse
ลูกค้าใหม่ซื้อครั้งแรกNew segment → onboarding rewardPharmacy ส่ง 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/signalsบันทึก 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 ต่อ action type
⚠️

Intelligence API อยู่ใน PBCP Core — ไม่ใช่ separate service deployment