What It Does
น้องสบายใจ is a Thai voice bot for Sabai Travel that sells travel insurance over a phone call — from destination inquiry through package selection to LINE OA handoff. One natural conversation, no menu trees.
Why This Bot
Travel insurance = predictable rules (zone mapping, date math, pricing, compliance) + consultative dialogue. Ideal showcase for Botlab 2.0's microservice flow architecture.
Product Coverage
3 packages (Basic / Standard / Premium) × 3 zones (ASEAN / Asia / Worldwide) × 3 brackets (1–7 / 8–14 / 15–30 days). Plus 5 add-on modules.
Demo Target
🎯 March 25 live demo — the bot runs as a voice call, handles mid-call topic changes, real-time pricing, and LINE handoff.
destination = ญี่ปุ่น, session_mode = buy. Triggers Flow 1.destination_zone = asia · season_flag = mildcompliance_flags = noneempathy_line = ซากุระบาน referenceMain Prompt weaves empathy line into greeting.
travel_start = 2026-03-28, travel_end = 2026-04-01, num_travelers = 2, travel_context = couple. Triggers Flow 2.🔹 Basic — 599 บาท/คน (รวม 1,198 บาท)
🔸 Standard — 1,099 บาท/คน (รวม 2,198 บาท)
🔶 Premium — 1,799 บาท/คน (รวม 3,598 บาท)
แนะนำ Standard ขึ้นไปสำหรับญี่ปุ่นค่ะ ค่ารักษาพยาบาลที่นั่นค่อนข้างสูง
trip_days = 5 → bracket 1–7Asia + Standard = 1,099/person
Main Prompt × 2 travelers, presents comparison.
selected_package = standard. Looks up add-ons from RAG KB 3 based on couple + asia context.📱 Gadget Protection — คุ้มครองมือถือ/กล้อง +400 บาท
🧳 Visa Cancellation — กรณีวีซ่าไม่ผ่าน +300 บาท
สนใจเพิ่มตัวไหนไหมคะ?
Matched Gadget + Visa Cancel based on context. Max 2 per conversation.
session_mode = inquiry. Re-triggers Flow 1 for France.🔹 Basic — 899 บาท/คน
🔸 Standard — 1,599 บาท/คน
🔶 Premium — 2,699 บาท/คน
⚠️ ขอแจ้งให้ทราบนะคะ ฝรั่งเศสเป็นประเทศกลุ่มเชงเก้น ซึ่งกำหนดวงเงินประกันขั้นต่ำประมาณ 1,100,000 บาท (30,000 EUR) แพ็กเกจ Basic วงเงิน 1,000,000 บาทอาจไม่ผ่านข้อกำหนด แนะนำ Standard หรือ Premium ค่ะ มีคำถามเพิ่มเติมไหมคะ?
⚡ Flow 2 (re-run): worldwide pricing
⚡ Flow 3 — ComplianceChecker fires → Schengen disclosure
session_mode = buy, selected_package = standard, selected_addons = none.📍 ญี่ปุ่น · 28 มี.ค. – 1 เม.ย. · 5 วัน · 2 คน
📦 Standard — 1,099 บาท/คน = รวม 2,198 บาท
ขอชื่อกับเบอร์โทรหรือ LINE ID เพื่อส่งรายละเอียดทาง LINE นะคะ
customer_name = สมศรี, customer_contact = somsri99. Triggers Flow 4.Sends formatted summary to LINE OA. Human agent picks up.
flowchart LR
START([📞 Call In]):::startEnd --> GREET[🤖 Greet &
Ask Destination]:::mainPrompt --> D_DEST{Destination
mentioned?}:::decision
D_DEST -->|No| GREET
D_DEST -->|Yes| F1[⚡ Flow 1
DestEnrich]:::silentFlow --> EMP[💬 Empathy +
Ask Dates]:::mainPrompt --> D_DATE{Dates
provided?}:::decision
D_DATE -->|No| EMP
classDef startEnd fill:#1e40af,stroke:#1e40af,color:#fff,font-weight:bold,font-size:11px
classDef mainPrompt fill:#fff,stroke:#2563eb,stroke-width:2px,color:#1e40af,font-weight:600,font-size:11px
classDef decision fill:#fffbeb,stroke:#f59e0b,stroke-width:2px,color:#92400e,font-weight:600,font-size:11px
classDef silentFlow fill:#f0fdfa,stroke:#44C9C1,stroke-width:2px,color:#0d9488,font-weight:600,font-size:11px
flowchart RL
F2[⚡ Flow 2
Pricing]:::silentFlow --> D_COMP{Compliance
flags?}:::decision
D_COMP -->|"none / empty"| PKG[📊 Package
Compare]:::mainPrompt
D_COMP -->|"flags exist"| F3[⚡ Flow 3
Compliance]:::silentFlow --> PKG
PKG --> D_CUST{Customer
decides}:::decision
D_CUST -->|Questions| PKG
classDef mainPrompt fill:#fff,stroke:#2563eb,stroke-width:2px,color:#1e40af,font-weight:600,font-size:11px
classDef decision fill:#fffbeb,stroke:#f59e0b,stroke-width:2px,color:#92400e,font-weight:600,font-size:11px
classDef silentFlow fill:#f0fdfa,stroke:#44C9C1,stroke-width:2px,color:#0d9488,font-weight:600,font-size:11px
flowchart LR
CONF[✅ Confirm &
Collect Info]:::mainPrompt --> F4[⚡ Flow 4
LINE Send]:::silentFlow --> ENDNODE([💬 LINE OA
Agent]):::handoff
classDef mainPrompt fill:#fff,stroke:#2563eb,stroke-width:2px,color:#1e40af,font-weight:600,font-size:11px
classDef silentFlow fill:#f0fdfa,stroke:#44C9C1,stroke-width:2px,color:#0d9488,font-weight:600,font-size:11px
classDef handoff fill:#7c3aed,stroke:#6d28d9,color:#fff,font-weight:bold,font-size:11px
Microservice pattern. The Main Prompt in Bot Studio handles conversation — greeting, empathy, package presentation, objection handling. 4 independent flows in Flow Studio handle deterministic tasks silently (Response Type OFF). Results return via End Node output parameters → Bot Studio variables.
Think: Main Prompt = the chef (judgment calls, talks to customer). Flows = kitchen tools (precise ops). The chef decides when to use each tool.
Bot Studio Configuration
The Main Prompt is the conversational brain — it manages the entire dialogue and decides when to trigger flows. The PD has flexibility on exact wording, but these behaviors must be present.
Persona & Tone
Name: น้องสบายใจ. Female Thai speaker, warm and professional, ค่ะ endings. Represents Sabai Travel (เดินทางสบาย). Should feel like a knowledgeable travel consultant.
Core Behaviors
1. Destination extraction → When customer mentions a destination, extract it and trigger Flow 1. Weave the returned empathy_line naturally.
2. Date extraction → Parse Thai date expressions into YYYY-MM-DD. Also extract num_travelers and travel_context. Then trigger Flow 2.
3. Package presentation → After Flow 2, present all 3 tiers with per-person and total pricing. Add contextual recommendation.
4. Compliance delivery → If Flow 3 returns a disclosure, embed it naturally after pricing.
5. Mode switching → Detect "แค่อยากรู้ราคา" → session_mode = inquiry. No contact collection. Switch back when ready.
6. Add-on timing → Only suggest after package selection. Use RAG KB 3. Max 2.
7. Handoff trigger → Customer confirms + provides contact → trigger Flow 4. Confirm LINE delivery and close warmly.
Flow Trigger Bindings
| Flow | Trigger | Inputs (Bot → Flow) | Outputs (Flow → Bot) |
|---|---|---|---|
| Flow 1 | Destination mentioned | destination | destination_zone, season_flag, compliance_flags, empathy_line |
| Flow 2 | Dates + zone available | travel_start, travel_end, destination_zone, selected_package | trip_days, estimated_premium |
| Flow 3 | flags ≠ "none" | compliance_flags, destination_zone, selected_package, num_travelers | disclosure_message |
| Flow 4 | Confirms + contact | All trip + customer vars (11) | handoff_status |
| Variable | Type | Default | Set By | Purpose |
|---|---|---|---|---|
destination | String | '' | Main Prompt | Customer's stated destination |
destination_zone | String | '' | Flow 1 | asean / asia / worldwide |
travel_start | String | '' | Main Prompt | Departure YYYY-MM-DD |
travel_end | String | '' | Main Prompt | Return YYYY-MM-DD |
trip_days | String | '0' | Flow 2 | Duration (inclusive) |
num_travelers | String | '1' | Main Prompt | Total travelers |
season_flag | String | '' | Flow 1 | hot/cold/rainy/mild |
empathy_line | String | '' | Flow 1 | Thai empathy sentence |
compliance_flags | String | 'none' | Flow 1 | none/schengen/advisory/safari_health |
selected_package | String | '' | Main Prompt | basic/standard/premium |
selected_addons | String | 'none' | Main Prompt | Comma-separated codes |
estimated_premium | String | '' | Flow 2 | Per-person THB |
customer_name | String | '' | Main Prompt | For LINE card |
customer_contact | String | '' | Main Prompt | Phone or LINE ID |
travel_context | String | 'leisure' | Main Prompt | solo/couple/family/business etc. |
session_mode | String | 'buy' | Main Prompt | buy = full app, inquiry = browse |
Flow 1 — DestinationEnricher
Purpose: Takes destination → returns zone, season, compliance flags, empathy line.
Start Node: destination
RAG Node: All 3 destination KBs. Query Rewriting ON (Thai city→country). Top K: 3, Score: 0.65, Reranking: On. Outputs: point_1, point_2, point_3.
LLM Node: Temp 0.2. Output params on node. Prompt: classify zone, detect season, set flags, generate Thai empathy.
End Node: destination_zone, season_flag, compliance_flags, empathy_line. Response Type: OFF.
point_1, point_2, point_3 — NOT outputList.Flow 2 — DateProcessor
Purpose: Dates + zone + package → trip duration and per-person premium.
Start Node: travel_start, travel_end, destination_zone, selected_package
Code Node: Python. Positional args to main().
End Node: trip_days, estimated_premium (per person). Response Type: OFF.
{{param}} in Code Nodes.estimated_premium is per person. Main Prompt × num_travelers.Flow 3 — ComplianceChecker
Purpose: Compliance flags → Thai disclosure (or silent skip).
Start Node: compliance_flags, destination_zone, selected_package, num_travelers
Condition: "none" OR "" → END A. Else → LLM. Both as separate OR branches.
LLM prompt:
End Node B: discolsure_message (⚠️ typo — fix to disclosure_message). Response Type: OFF.
{{variable}} goes in context block at bottom — never in instructions.Flow 4 — LineHandoff
Purpose: Sends formatted summary to LINE OA. Final step.
Start Node: customer_name, customer_contact, destination, destination_zone, travel_start, travel_end, trip_days, selected_package, estimated_premium, num_travelers, compliance_flags
Code Node: Python. Constructs formatted text + POSTs to LINE Messaging API. Uses ssl._create_unverified_context() for sandbox SSL.
End Node: handoff_status. Response Type: OFF.
All KBs: Top K: 3, Score: 0.65, Reranking: On, Query Rewriting: On (critical for Thai).
travel_packages_th.txt — 3 tiers × 3 zones × 3 brackets + coverage details + comparison guidance. Used by Main Prompt.destinations_asean_th.txt, _asia_th.txt, _worldwide_th.txt — Split into 3 (Milvus 8,192 char limit). Zone, weather, empathy lines, flags. Used by Flow 1.travel_addons_th.txt — 5 add-ons: Adventure Sports (500฿), Gadget (400฿), Visa Cancel (300฿), Golf (400฿), Rental Car (350฿). Used by Main Prompt.travel_compliance_th.txt — OIC disclosures: pre-existing, sports, Schengen (30,000 EUR), advisories, age, pregnancy. Used by Flow 3 LLM.| Zone | Duration | Basic | Standard | Premium |
|---|---|---|---|---|
| ASEAN | 1–7 days | 299 | 549 | 899 |
| 8–14 days | 499 | 899 | 1,499 | |
| 15–30 days | 799 | 1,399 | 2,299 | |
| Asia | 1–7 days | 599 | 1,099 | 1,799 |
| 8–14 days | 999 | 1,799 | 2,999 | |
| 15–30 days | 1,599 | 2,799 | 4,599 | |
| Worldwide | 1–7 days | 899 | 1,599 | 2,699 |
| 8–14 days | 1,499 | 2,699 | 4,499 | |
| 15–30 days | 2,399 | 4,299 | 7,199 |
Note: 2+ travelers on same policy get 5% discount/person (not yet in prototype).