Connect
Connect is an omnichannel inbox + chat widget built on PBCP — enabling the admin team to talk to customers from every channel in one place, with a full Customer Story panel alongside the screen, and the ability to send coupons or rewards without leaving the inbox.
The Problem Connect Solves
Most businesses are juggling 3–4 places to talk to customers at once — Facebook Page, LINE OA, Email, and web chat. Admins have to switch tabs constantly, never knowing whether the customer asking on LINE is the same one who complained on Facebook, and they have no customer background when replying.
Connect solves all three at once.
Architecture Overview
ลูกค้า
│
├── LINE OA ─────────────┐
├── Facebook Messenger ──┤
├── Web Chat Widget ─────┤──► Channel Adapters ──► Unified Inbox
└── Email ───────────────┘ │
▼
┌──────────────────────┐
│ Admin workspace │
│ │
│ [Conversation] │
│ [Customer Story] ◄──┼── PBCP Core
│ [AI Suggestion] ◄───┼── Content OS
│ [Send Reward] ◄─────┼── Intelligence
└──────────────────────┘
│
conversation.* events
│
▼
PBCP Core
(Q&A corpus + Customer Story)Unified Inbox
Admins see conversations from every channel on one page. Each thread shows:
- Channel badge — LINE / Facebook / Email / Web
- Customer name — resolved from PIP across channels automatically
- Last message + timestamp
- Status — open / pending / resolved
- Assigned to — which staff member picked it up
When a conversation is opened, the right panel immediately displays the Customer Story from PBCP:
┌──────────────────────────────┬──────────────────────────────┐
│ Conversation │ Customer Story │
│ │ │
│ [LINE] คุณสมชาย │ ลูกค้า: สมชาย จันทร์ดี │
│ "ยา Amlodipine หมดแล้ว │ Segment: loyal │
│ สั่งซื้อได้มั้ยครับ" │ Last visit: 3 วันที่แล้ว │
│ │ ยาประจำ: Amlodipine 5mg │
│ [Reply box] │ ซื้อซ้ำทุก: ~28 วัน │
│ │ Churn risk: low ✅ │
│ 💊 Suggest: "ได้เลยครับ │ │
│ Amlodipine 5mg 30 เม็ด │ [ดู full story →] │
│ ราคา ฿180 จัดส่งได้วันนี้ │ │
│ ต้องการสั่งเลยไหมครับ?" │ │
│ │ │
│ [✓ Send] [Edit] [Reward] │ │
└──────────────────────────────┴──────────────────────────────┘AI-Suggested Replies
For every incoming conversation, Connect pulls from 3 layers to generate a reply for the admin:
Layer 1 — Customer Story (PBCP): Who this customer is, what they've bought, and any outstanding issues
Layer 2 — Q&A Corpus (Connect): How questions like this have been answered before, and whether the customer was satisfied
Layer 3 — Brand DNA (Content OS): What tone this store uses — formal or friendly — and what vocabulary is regularly used
The admin can press ✓ Send to send as-is, or edit before sending — no need to type everything from scratch.
Chatbot Mode
When no admin is online, or when the question clearly matches the Q&A corpus, the Chatbot can respond automatically.
Routing logic:
ลูกค้าส่งข้อความ
↓
Chatbot ดู Q&A corpus
↓
confidence ≥ 80% → ตอบอัตโนมัติ
confidence < 80% → ส่งให้ admin + notify
นอก business hours → auto-reply + queueEvery Chatbot reads Brand DNA first — responses are never off-brand, and the chatbot understands the business domain — for example, a pharmacy chatbot knows about medications, and a hotel chatbot knows about reservations.
Send Rewards & Coupons
Once Intelligence detects a signal → the admin can send a reward directly from inside the conversation thread without going anywhere else.
Example scenarios:
| Situation | Intelligence signal | What Admin Can Do |
|---|---|---|
| Customer complains about delay | complaint.raised | Press Send Coupon → 10% off next order |
| Loyal customer asks to repurchase | segment: loyal | Press Send Reward → bonus 2x points |
| At-risk customer asks to cancel | churn_risk: high | Press Send Offer → special retention deal |
| Customer birthday | birthday.offer_sent | Message + coupon sent in the LINE channel they're using |
Customers receive the reward in the channel they are currently using — no need to go elsewhere — creating a seamless and memorable experience.
Web Chat Widget
For businesses with a website or app, the Connect Widget can be installed with a single script line:
<script
src="https://connect.pcampus.app/widget.js"
data-tenant="your-tenant-id"
data-position="bottom-right"
data-color="#2563eb"
></script>The Widget knows who is currently logged in, enabling the Chatbot to greet them by name and immediately pull context from PBCP — without asking for basic information again.
Identity: Use Your Existing Auth Provider
Connect does not require switching to PIP — it supports External Identity Providers via token exchange, so businesses already using Firebase Auth, Auth0, Supabase, Clerk, or custom JWT do not need to migrate anything.
Firebase Auth (most common):
import { getAuth } from 'firebase/auth'
const auth = getAuth()
const token = await auth.currentUser.getIdToken()
ConnectWidget.init({
tenant: 'your-tenant-id',
identityProvider: 'firebase',
identityToken: token, // ← Firebase ID Token
position: 'bottom-right',
color: '#2563eb'
})Other providers:
ConnectWidget.init({
tenant: 'your-tenant-id',
identityProvider: 'custom',
jwksUri: 'https://your-auth-server/.well-known/jwks.json',
identityToken: yourJwtToken
})External IdP Flow
ลูกค้า login ด้วย Firebase / Auth0 / etc.
↓
app เรียก getIdToken()
↓
ส่ง token เข้า ConnectWidget.init()
↓
Connect backend verify token
(ใช้ Firebase public JWKS — ไม่ต้องการ service account key)
↓
ดึง email / phone จาก token claims
↓
Match กับ PBCP customer record
├─ เจอ → bind external_uid → customer ทันที
└─ ไม่เจอ → สร้าง customer ใหม่ + bind อัตโนมัติ
↓
ออก Connect session token (short-lived)
↓
Widget รู้จักลูกค้า → ดึง Customer Story ได้เลยThe bind happens once, automatically — customers never notice this step. The next time they log in, the system resolves their identity instantly.
Console Setup (One-Time)
Before using an External IdP, register the provider in PBCP Console:
| Provider | Required Information |
|---|---|
| Firebase | Firebase Project ID |
| Auth0 | Domain + Audience |
| Supabase | Project URL + JWT Secret |
| Custom JWT | JWKS URI or Public Key (RS256/ES256) |
Connect verifies tokens via public key / JWKS endpoint without requiring a service account key — safer than sharing credentials.
Claims Used by Connect to Resolve Identity
| Priority | Claim | Notes |
|---|---|---|
| 1 | email | Matched against PBCP customer email |
| 2 | phone_number | Matched against PBCP customer phone |
| 3 | sub (UID) | Fallback — creates a new customer if not found |
Domain-Customizable Widget:
// Pharmacy — แสดงปุ่มลัด
{
quickActions: ["ประวัติยา", "สั่งยาซ้ำ", "ปรึกษาเภสัชกร"]
}
// Hotel — แสดง reservation ปัจจุบัน
{
quickActions: ["ดูการจอง", "ขอ late checkout", "room service"]
}
// Restaurant — แสดง membership tier
{
quickActions: ["ยอด points", "จองโต๊ะ", "โปรโมชั่นวันนี้"]
}Q&A Corpus → Intelligence Feedback Loop
Every resolved conversation becomes training data for Intelligence:
conversation.resolved
↓
Q&A pair บันทึกลง corpus
(คำถาม + คำตอบ + customer profile + outcome)
↓
Intelligence เรียนรู้ pattern:
"ลูกค้า segment นี้ มักถามเรื่องนี้ ในช่วงนี้"
↓
Proactive message: ส่งคำตอบก่อนที่เขาจะถามThe longer Connect is used, the more proactive the system becomes.
Events That Connect Sends Back to PBCP
| Event | Triggered when |
|---|---|
conversation.started | Customer sends their first message |
message.received | A message is received from the customer |
message.sent | Admin or chatbot replies |
suggestion.accepted | Admin presses Send following the AI suggestion |
suggestion.edited | Admin edits the suggestion before sending |
reward.sent_via_chat | A coupon / reward is sent in the conversation |
conversation.escalated | Chatbot escalates to admin |
conversation.resolved | Conversation is closed |
feedback.given | Customer rates the conversation |
This data flows into the Customer Story — allowing Pulse to display the conversation timeline alongside the transaction history.
Evaluation Signals — Measuring AI and Human Performance
Connect is the point where evaluation data is generated — every interaction in the inbox is a signal that Intelligence uses to learn.
AI Quality Signals
| Event | Meaning | What Intelligence Learns |
|---|---|---|
suggestion.accepted | Admin sends the AI reply as-is | This suggestion was correct in this context |
suggestion.edited | Admin edits before sending | What was edited → adjust the Q&A corpus |
suggestion.dismissed | Admin does not use it | AI miss — must relearn this pattern |
chatbot.answered | Chatbot responds automatically | — |
chatbot.escalated | Chatbot cannot answer → escalates to admin | This topic needs to be added to the Q&A |
Human Quality Signals
| Signal | Collected from | Used to measure |
|---|---|---|
| First response time | Timestamp between message.received → first message.sent | Speed of each admin |
| Resolution time | Timestamp between conversation.started → conversation.resolved | Overall efficiency |
| CSAT score | feedback.given event (customer rates 1–5 after resolved) | Customer satisfaction |
| Edit distance | Compare suggestion against the actual message sent | How accurate the AI is |
Outcome Attribution Signals
Connect records the conversation context in the Customer Story — when a business event occurs afterward, Intelligence can attribute which action led to the outcome:
conversation.resolved (ส่ง coupon WINBACK10)
↓ 5 วันต่อมา
order.placed (ใช้ WINBACK10)
↓
Intelligence บันทึก: "win-back coupon after at_risk conversation → conversion = true"
↓
recommendation confidence สำหรับ at_risk segment เพิ่มขึ้นEvaluation Dashboard (Console — MVP2)
Console → Connect → Analytics:
| Page | Data Displayed |
|---|---|
| AI Performance | Suggestion acceptance rate, edit distance avg, chatbot resolution rate per topic |
| Staff Performance | Response time, resolution time, CSAT per staff — not a ranking, but a coaching insight |
| Outcome | Conversion rate per action type (coupon, reminder, recommendation) |
| Trend | Compare AI quality this week vs. last week — is the system improving? |
How Connect Differs from Intercom / Zendesk
| Feature | Connect | Intercom / Zendesk |
|---|---|---|
| Unified inbox | ✅ | ✅ |
| Chat widget | ✅ | ✅ |
| AI reply suggestion | ✅ | ✅ (generic) |
| Customer Story from transactional data | ✅ (PBCP) | ❌ |
| Domain-aware context (pharmacy, hotel, etc.) | ✅ | ❌ |
| Send coupon / reward from within chat | ✅ | ❌ |
| Q&A → Intelligence proactive loop | ✅ | ❌ |
| Brand DNA-driven tone per tenant | ✅ (Content OS) | ❌ |
MVP Channels
| Phase | Channels |
|---|---|
| MVP | LINE OA, Facebook Messenger, Web Widget |
| Phase 2 | Email (inbound), Instagram DM |
| Future | WhatsApp Business, TikTok DM |