📋 Logging — Agent Status & AI Answer Queue
สถานะ/เหตุการณ์ของ WhatsApp Agent ในช่องของคุณ · คิวคำถามค้าง (ปิดงานเองเมื่อ AI/พนักงานตอบ)
Dashboard
LifeSpan Birth Chatbot-CRM overview
💬 Recent conversations
| Phone | Name | Stage | Messages | Last |
|---|---|---|---|---|
| Loading… | ||||
🎓 Global Knowledge Training
พนักงานสอน AI ผ่าน WhatsApp Channel-2 → บันทึกลง DB → Compile เป็น version → เลือกใช้งาน
📋 วิธีสอน พนักงานทักเข้า Channel-2 (+66829946741) แล้วพิมพ์ format ใด format หนึ่ง
ผลไม่เกิดทันที — บทเรียนจะถูกเก็บไว้ ต้อง Compile เป็น version ใหม่แล้วเลือกใช้ก่อน AI ถึงจะใช้
🇹🇭 ไทย --- Instance Training: Global Knowledge (LifeSpan Birth) --- ถ้าคำตอบถูกต้อง (Positive): - แนะนำเพิ่ม: <เพิ่มเติม> หรือ no comment ถ้าคำตอบไม่ถูกต้อง (Negative): - ตัวอย่างคำตอบที่ถูก: <คำตอบที่ถูก> --- End Instance Training ---
🇬🇧 English --- Instance Training: Global Knowledge (LifeSpan Birth) --- If the answer is correct (Positive): - suggest adding: <extra> or No comment If the answer is incorrect (Negative): - example of the correct answer: <correct> --- End Instance Training ---
📦 Versions (เลือก 1 ตัวเป็น active — ตัวที่ AI ใช้จริง)
| — กด refresh — |
👥 ใครสอนเข้ามาบ้าง (แยกตามผู้สอน)
| 👨🏫 ผู้สอน | เบอร์ | จำนวนบทเรียน | ล่าสุด |
|---|
📝 Instance Training List (บทเรียนทั้งหมดจาก DB)
| # | 👨🏫 ผู้สอน | 👍 ถูก / แนะนำเพิ่ม | 👎 ผิด → ✏️ ที่ถูก | ดู | เวลา | ver |
|---|
💬 แชทของฉัน
บทสนทนา WhatsApp ของสายที่คุณดูแล — บอททำงานเบื้องหลังตลอดแม้คุณ logout
ข้อความจะแสดงที่นี่
WhatsApp Channels
Click "Pair / Show QR" on a channel → scan with the WhatsApp app (Settings → Linked Devices → Link a Device)
⚠️ Use clinic-dedicated numbers only · never message people who did not contact you first (reduces ban risk)
🔗 User Mapping — team ↔ WhatsApp line (admin only)
| Team member | WhatsApp line | Label |
|---|
Contacts
Patients who chat via WhatsApp — auto-synced to SignifyCRM
| Phone | Name | Stage | SignifyCRM ID | Messages |
|---|
Team & Roles
Permissions: CEO / Manager / Sale
➕ Add team member
👑 Admin Panel
| Name | Role | Actions |
|---|
Admins manage the system only — no WhatsApp line, no API key, not in the mapping list
👥 Team (Sale / Manager)
| Name | Role | API Key | Actions |
|---|
🔗 API keys let SignifyCRM call in as that user (header X-API-Key) — see endpoints in the Integration tab
Web RAG (Qdrant)
Website knowledge the bot uses to answer patients
🌐 Ingest a web page
Two shared KBs — the bot uses the KB assigned per contact (🤖 button in chat). Personal KBs live in the Knowledge tab.
Integration
SignifyCRM connection and system info
🌐 Global AI System Prompt (base identity of every bot — admin only)
Layering: Global prompt → Clinic Info → user Persona → user System Prompt → Skills → RAG
📍 Clinic Info / ข้อมูลสาขา (ต่อท้าย prompt เสมอ — เก็บใน Postgres ไม่พึ่ง RAG)
ที่ตั้ง เบอร์ เวลาทำการ ลิงก์แผนที่ ฯลฯ — AI ใช้ตอบได้แม้เครดิต embedding หมด · มีหลายสาขา → เขียนกฎให้ AI ถามก่อนส่งลิงก์
🔎 ตัวอย่าง System Prompt เต็ม (ที่ AI เห็นจริง — รวมทุกชั้น)
รวม Global + Clinic + Persona + System Prompt สาย + Skills (ยังไม่รวม RAG ที่ดึงตอนตอบจริง)
🔌 Model Providers (API key ของ LLM — แก้ได้ที่นี่ ไม่ต้องแก้ .env)
ตั้ง API key ต่อ provider — เก็บใน DB (ถ้าเว้นว่างจะใช้ค่าจาก env เดิม) · มีผลทันทีกับการเรียก AI/embeddings
🔗 Chat Server API for SignifyCRM (auth: per-user X-API-Key header)
GET /api/v1/me | User info + available WhatsApp lines |
GET /api/v1/chats | Conversation list (user's lines only) |
GET /api/v1/chats/{phone}?account=hermes-N | Messages in a conversation |
POST /api/v1/chat/send {phone, message, account?} | Send a message (queued in outbox) |
| Webhook (us → SignifyCRM) | POST message.received events to the user's Webhook URL (set in Team tab → edit) |
Base URL: https://lifespan-cowork.ant2cloud.com · Issue API keys: Team tab → "🔗 Issue key"
⚙️ System
| Legacy inbound | POST /api/signify/inbound PUBLIC_API_KEY |
| Server | [email protected] · /opt/dockers/chatbot-crm |