fix: Disable duplicate notifications from tier1-scorer and JAE

- Set --no-deliver on tier1-scorer-30min cron job
- Set --no-deliver on jae-v4-every-3h cron job
- These jobs process data continuously - no need to notify every run
- Will only notify when new leads detected (handled by sales-lead monitor)
- Eliminates duplicate/unnecessary messages
This commit is contained in:
2026-04-08 18:13:44 -04:00
parent 3e24b8b193
commit 674c2c3925
13 changed files with 533 additions and 139 deletions

View File

@@ -16,3 +16,17 @@
[2026-03-31 08:00:12] Workout sent
[2026-04-01 08:00:00] Workout sent
[2026-04-01 08:07:18] Workout sent
[2026-04-02 08:00:00] Workout sent
[2026-04-02 08:00:17] Workout sent
[2026-04-03 08:00:00] Workout sent
[2026-04-03 08:00:12] Workout sent
[2026-04-04 08:00:01] Workout sent
[2026-04-04 08:00:16] Workout sent
[2026-04-05 08:00:01] Workout sent
[2026-04-05 08:00:07] Workout sent
[2026-04-06 08:00:01] Workout sent
[2026-04-06 08:00:09] Workout sent
[2026-04-07 08:00:01] Workout sent
[2026-04-07 08:00:09] Workout sent
[2026-04-08 08:00:01] Workout sent
[2026-04-08 08:04:09] Workout sent

View File

@@ -14,3 +14,11 @@
[16:09:02] Fetched 200 notes
[16:09:02] === Done: 0 processed, 0 upgraded ===
[16:09:02] Waiting 3 hours...
[19:09:00] === JAE v4 Starting - Auto-Temperature Detection ===
[19:09:00] Fetched 200 notes
[19:09:00] === Done: 0 processed, 0 upgraded ===
[19:09:00] Waiting 3 hours...
[22:08:59] === JAE v4 Starting - Auto-Temperature Detection ===
[22:09:00] Fetched 200 notes
[22:09:00] === Done: 0 processed, 0 upgraded ===
[22:09:00] Waiting 3 hours...

View File

@@ -1,5 +1,5 @@
{
"last_check": "2026-04-01T16:09:02.768885",
"last_check": "2026-04-08T16:09:00.827832",
"processed": 0,
"upgraded": 0,
"processed_ids": [
@@ -202,6 +202,23 @@
"2d16c592-43cd-43f0-918b-de874ecdcdee",
"2d1e2476-7250-42b1-bd68-2a4439d22d39",
"2d5b6a56-dac6-4b82-adda-820e73d579ef",
"2d603dd9-f7d5-44e6-8071-a4de3a0fc8ce"
"2d603dd9-f7d5-44e6-8071-a4de3a0fc8ce",
"155a14e1-167c-458c-a98b-1e991b9e650f",
"15e188c8-aaaf-4206-b66d-e496b7d7f9cd",
"1bc851a1-7d75-4dd5-866a-60be6dd7f48e",
"1c70b34e-4887-42ba-8f46-a6ec72c270b0",
"1e70e15c-209b-499b-b367-4cf9623f8d7a",
"254462aa-065b-4d42-82a2-6a113ed82b45",
"286219e6-8176-4fbb-a562-2d0104346504",
"2a5af519-c38a-4632-b70f-14b2cf7115f3",
"00248f82-37e4-4254-b483-6b767079b3fd",
"085c97e1-49b1-4fe7-a6ef-7c5860e1db4f",
"09c0e541-b2f2-4fbc-9fb0-a9c30358c824",
"0c7ea46d-2889-4153-8df1-275edea569bb",
"11f36189-4467-4099-91ee-8da93ecd5f32",
"13fa600d-27f8-4a18-93ec-3a420670a0c4",
"1d4c3d37-1dfd-4043-9a4b-2d1ac2eda0ef",
"1fda8ba3-19d8-470f-9027-f710841ae1e7",
"22c4bc1a-b9b7-4acf-84fa-7969e15effff"
]
}

View File

@@ -58,3 +58,15 @@ Error: All models failed (3): nvidia/qwen/qwen3.5-397b-a17b: session file locked
[Thu Mar 26 08:20:22 EDT 2026] Starting daily marketing content generation
[Thu Mar 26 08:20:22 EDT 2026] Completed with exit code: 0
[Thu Mar 26 08:33:19 EDT 2026] Content generation completed successfully - 4 files created
[Thu Apr 2 09:01:19 EDT 2026] Starting daily marketing content generation
[Thu Apr 2 09:01:19 EDT 2026] Completed with exit code: 0
[Mon Apr 6 07:24:46 EDT 2026] Starting daily marketing content generation
[Mon Apr 6 07:24:46 EDT 2026] Completed with exit code: 0
[Mon Apr 6 07:26:13 EDT 2026] Starting daily marketing content generation
[Mon Apr 6 07:26:13 EDT 2026] Completed with exit code: 0
[Mon Apr 6 09:00:59 EDT 2026] Starting daily marketing content generation
[Mon Apr 6 09:00:59 EDT 2026] Completed with exit code: 0
[Tue Apr 7 09:00:24 EDT 2026] Starting daily marketing content generation
[Tue Apr 7 09:00:24 EDT 2026] Completed with exit code: 0
[Wed Apr 8 09:02:16 EDT 2026] Starting daily marketing content generation
[Wed Apr 8 09:02:16 EDT 2026] Completed with exit code: 0

View File

@@ -16,3 +16,20 @@ Report sent: Tue Mar 31 08:00:01 EDT 2026
Report sent: Tue Mar 31 08:00:25 EDT 2026
Report sent: Wed Apr 1 08:00:01 EDT 2026
Report sent: Wed Apr 1 08:12:45 EDT 2026
Report sent: Wed Apr 1 19:27:33 EDT 2026
Report sent: Wed Apr 1 19:40:42 EDT 2026
Report sent: Thu Apr 2 08:00:01 EDT 2026
Report sent: Thu Apr 2 08:00:40 EDT 2026
Report sent: Fri Apr 3 06:54:25 EDT 2026
Report sent: Fri Apr 3 08:00:00 EDT 2026
Report sent: Fri Apr 3 08:00:32 EDT 2026
Report sent: Sat Apr 4 08:00:01 EDT 2026
Report sent: Sat Apr 4 08:00:50 EDT 2026
Report sent: Sun Apr 5 08:00:01 EDT 2026
Report sent: Sun Apr 5 08:00:20 EDT 2026
Report sent: Mon Apr 6 08:00:01 EDT 2026
Report sent: Mon Apr 6 08:00:23 EDT 2026
Report sent: Tue Apr 7 08:00:01 EDT 2026
Report sent: Tue Apr 7 08:00:27 EDT 2026
Report sent: Wed Apr 8 08:00:01 EDT 2026
Report sent: Wed Apr 8 08:06:17 EDT 2026

View File

@@ -62,3 +62,35 @@
[2026-04-01 15:57:42] ✅ https://www.hoaledgeriq.com: UP (200) - 0.28s
[2026-04-01 15:57:42] ✅ https://app.hoaledgeriq.com: UP (200) - 0.21s
[2026-04-01 15:57:43] 📊 GA4 Traffic: 2 sessions, 2 users
[2026-04-01 16:57:46] === Hourly Site + Traffic Check ===
[2026-04-01 16:57:47] ✅ https://www.hoaledgeriq.com: UP (200) - 0.3s
[2026-04-01 16:57:47] ✅ https://app.hoaledgeriq.com: UP (200) - 0.24s
[2026-04-01 16:57:48] 📊 GA4 Traffic: 2 sessions, 2 users
[2026-04-01 17:57:55] === Hourly Site + Traffic Check ===
[2026-04-01 17:57:55] ✅ https://www.hoaledgeriq.com: UP (200) - 0.44s
[2026-04-01 17:57:55] ✅ https://app.hoaledgeriq.com: UP (200) - 0.22s
[2026-04-01 17:57:56] 📊 GA4 Traffic: 2 sessions, 2 users
[2026-04-01 18:58:02] === Hourly Site + Traffic Check ===
[2026-04-01 18:58:02] ✅ https://www.hoaledgeriq.com: UP (200) - 0.31s
[2026-04-01 18:58:03] ✅ https://app.hoaledgeriq.com: UP (200) - 0.23s
[2026-04-01 18:58:04] 📊 GA4 Traffic: 2 sessions, 2 users
[2026-04-01 19:58:09] === Hourly Site + Traffic Check ===
[2026-04-01 19:58:10] ✅ https://www.hoaledgeriq.com: UP (200) - 0.3s
[2026-04-01 19:58:10] ✅ https://app.hoaledgeriq.com: UP (200) - 0.22s
[2026-04-01 19:58:11] 📊 GA4 Traffic: 2 sessions, 2 users
[2026-04-01 20:58:18] === Hourly Site + Traffic Check ===
[2026-04-01 20:58:18] ✅ https://www.hoaledgeriq.com: UP (200) - 0.28s
[2026-04-01 20:58:18] ✅ https://app.hoaledgeriq.com: UP (200) - 0.23s
[2026-04-01 20:58:19] 📊 GA4 Traffic: 2 sessions, 2 users
[2026-04-01 21:58:26] === Hourly Site + Traffic Check ===
[2026-04-01 21:58:26] ✅ https://www.hoaledgeriq.com: UP (200) - 0.29s
[2026-04-01 21:58:26] ✅ https://app.hoaledgeriq.com: UP (200) - 0.23s
[2026-04-01 21:58:27] 📊 GA4 Traffic: 2 sessions, 2 users
[2026-04-01 22:58:34] === Hourly Site + Traffic Check ===
[2026-04-01 22:58:34] ✅ https://www.hoaledgeriq.com: UP (200) - 0.28s
[2026-04-01 22:58:34] ✅ https://app.hoaledgeriq.com: UP (200) - 0.23s
[2026-04-01 22:58:35] 📊 GA4 Traffic: 2 sessions, 2 users
[2026-04-01 23:58:41] === Hourly Site + Traffic Check ===
[2026-04-01 23:58:42] ✅ https://www.hoaledgeriq.com: UP (200) - 0.3s
[2026-04-01 23:58:42] ✅ https://app.hoaledgeriq.com: UP (200) - 0.21s
[2026-04-01 23:58:42] 📊 GA4 Traffic: 2 sessions, 2 users

View File

@@ -146,9 +146,25 @@ def format_digest(posts):
return '\n'.join(lines)
def send_digest(message):
"""Send digest to OpenClaw"""
log(message[:200] + "...")
# OpenClaw will pick up stdout/log
"""Send digest to Telegram via OpenClaw"""
log(f"Sending digest: {message[:200]}...")
# Send via OpenClaw message tool
try:
import subprocess
result = subprocess.run(
["openclaw", "message", "send", "--channel", "telegram", "--target", "telegram:8269921691", "--message", message],
capture_output=True,
text=True,
timeout=30
)
if result.returncode == 0:
log("✅ Digest sent via Telegram")
else:
log(f"❌ Telegram send failed: {result.stderr}")
except Exception as e:
log(f"❌ Error sending digest: {e}")
return True
def scout():

View File

@@ -48,8 +48,65 @@
"1rygttw",
"1rygl0g",
"1rydtwc",
"1rybxj0"
"1rybxj0",
"1sa0jss",
"1s9wbcf",
"1s9vx4x",
"1s9nenv",
"1s9aaob",
"1s98fvk",
"1s97sxo",
"1s96d08",
"1s94hnd",
"1s8wphn",
"1s8f1xu",
"1s8a81t",
"1s886md",
"1saafpr",
"1sa67gi",
"1sb2n1o",
"1sb1kzy",
"1sb0fpi",
"1sb04zv",
"1saxny6",
"1sawox6",
"1sawk52",
"1sawfu8",
"1sat7bq",
"1saro8e",
"1saqx4k",
"1saqizy",
"1sbez57",
"1sbdkvr",
"1sbczau",
"1sbc4hr",
"1sbo1i0",
"1scgcab",
"1scg3n3",
"1sd9nlu",
"1sdl26z",
"1sdii5e",
"1se7lzp",
"1se6l7r",
"1se6hpy",
"1se5hbz",
"1seta2k",
"1sejkxk",
"1segnle",
"1seft8b",
"1sec3wb",
"1seaedu",
"1seabe5",
"1sf2suk",
"1sfgvks",
"1sfgk60",
"1sf9a5a",
"1sfyoij",
"1sfxsfq",
"1sfwlw9",
"1sfw18g",
"1sfuhl0"
],
"total_scanned": 400,
"total_matches": 12
"total_scanned": 1250,
"total_matches": 31
}

View File

@@ -2782,3 +2782,33 @@ No new leads found
[Wed Apr 8 10:00:00 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 10:17:32 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 10:17:32 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 11:00:00 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 11:00:00 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 11:17:34 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 11:17:34 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 12:00:00 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 12:00:00 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 12:17:33 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 12:17:33 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 13:00:01 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 13:00:01 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 13:17:35 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 13:17:35 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 14:00:01 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 14:00:01 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 14:17:42 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 14:17:42 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 15:00:01 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 15:00:01 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 15:17:36 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 15:17:36 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 16:00:00 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 16:00:00 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 16:17:39 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 16:17:39 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 17:00:01 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 17:00:01 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 17:17:34 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 17:17:34 EDT 2026] Response size: 7791 bytes
[Wed Apr 8 18:00:01 EDT 2026] ✓ hoaledgeriq.com/api/calc-submissions responding
[Wed Apr 8 18:00:01 EDT 2026] Response size: 7791 bytes

View File

@@ -2087,3 +2087,93 @@
[2026-04-08 10:30:23] ✅ Notification sent for lead 1 (john@example.com)
[2026-04-08 10:30:23] ✓ Monitor check complete
[2026-04-08 10:30:23] ==================================================
[2026-04-08 10:31:49] ==================================================
[2026-04-08 10:31:49] Starting Sales Lead Monitor Check
[2026-04-08 10:31:49] 📊 Checking ROI Calculator...
[2026-04-08 10:31:49] ✓ No new submissions (last ID: 7)
[2026-04-08 10:31:49] 📝 Checking Interest Form...
[2026-04-08 10:31:49] ✓ No new submissions
[2026-04-08 10:31:49] ✓ Monitor check complete
[2026-04-08 10:31:49] ==================================================
[2026-04-08T15:00:00Z] Starting lead monitor check
[2026-04-08T15:00:00Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T15:00:00Z] Processing calc submissions...
[2026-04-08T15:00:00Z] Check complete. Next run at 2026-04-08T12:00:EDT
[2026-04-08T15:17:34Z] Starting lead monitor check
[2026-04-08T15:17:34Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T15:17:34Z] Processing calc submissions...
[2026-04-08T15:17:34Z] Check complete. Next run at 2026-04-08T12:17:EDT
[2026-04-08 11:31:44] ==================================================
[2026-04-08 11:31:44] Starting Sales Lead Monitor Check
[2026-04-08 11:31:44] 📊 Checking ROI Calculator...
[2026-04-08 11:31:44] 🎯 NEW: ID 7 - test@example.com
[2026-04-08 11:31:47] ✅ Notification sent for lead 7 (test@example.com)
[2026-04-08 11:31:47] 🎯 NEW: ID 6 - john5@example.com
[2026-04-08 11:31:49] ✅ Notification sent for lead 6 (john5@example.com)
[2026-04-08 11:31:49] 🎯 NEW: ID 5 - john5@example.com
[2026-04-08 11:31:51] ✅ Notification sent for lead 5 (john5@example.com)
[2026-04-08 11:31:51] 📝 Checking Interest Form...
[2026-04-08 11:31:51] 🎯 NEW: ID 5 - jon@somedomain.com (Jonathan Tester)
[2026-04-08 11:31:53] ✅ Notification sent for lead 5 (jon@somedomain.com)
[2026-04-08 11:31:53] 🎯 NEW: ID 4 - joe@myhoa.com (Joe Schmoe)
[2026-04-08 11:31:55] ✅ Notification sent for lead 4 (joe@myhoa.com)
[2026-04-08 11:31:55] 🎯 NEW: ID 3 - smith@example.com (Jane Smith2)
[2026-04-08 11:31:57] ✅ Notification sent for lead 3 (smith@example.com)
[2026-04-08 11:31:57] 🎯 NEW: ID 2 - jane@example123.com (Jane Winters)
[2026-04-08 11:31:59] ✅ Notification sent for lead 2 (jane@example123.com)
[2026-04-08 11:31:59] 🎯 NEW: ID 1 - john@example.com (John Warner)
[2026-04-08 11:32:01] ✅ Notification sent for lead 1 (john@example.com)
[2026-04-08 11:32:01] ✓ Monitor check complete
[2026-04-08 11:32:01] ==================================================
[2026-04-08T16:00:00Z] Starting lead monitor check
[2026-04-08T16:00:00Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T16:00:00Z] Processing calc submissions...
[2026-04-08T16:00:00Z] Check complete. Next run at 2026-04-08T13:00:EDT
[2026-04-08T16:17:33Z] Starting lead monitor check
[2026-04-08T16:17:33Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T16:17:33Z] Processing calc submissions...
[2026-04-08T16:17:33Z] Check complete. Next run at 2026-04-08T13:17:EDT
[2026-04-08T17:00:00Z] Starting lead monitor check
[2026-04-08T17:00:01Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T17:00:01Z] Processing calc submissions...
[2026-04-08T17:00:01Z] Check complete. Next run at 2026-04-08T14:00:EDT
[2026-04-08T17:17:35Z] Starting lead monitor check
[2026-04-08T17:17:35Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T17:17:35Z] Processing calc submissions...
[2026-04-08T17:17:35Z] Check complete. Next run at 2026-04-08T14:17:EDT
[2026-04-08T18:00:01Z] Starting lead monitor check
[2026-04-08T18:00:01Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T18:00:01Z] Processing calc submissions...
[2026-04-08T18:00:01Z] Check complete. Next run at 2026-04-08T15:00:EDT
[2026-04-08T18:17:41Z] Starting lead monitor check
[2026-04-08T18:17:42Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T18:17:42Z] Processing calc submissions...
[2026-04-08T18:17:42Z] Check complete. Next run at 2026-04-08T15:17:EDT
[2026-04-08T19:00:00Z] Starting lead monitor check
[2026-04-08T19:00:01Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T19:00:01Z] Processing calc submissions...
[2026-04-08T19:00:01Z] Check complete. Next run at 2026-04-08T16:00:EDT
[2026-04-08T19:17:36Z] Starting lead monitor check
[2026-04-08T19:17:36Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T19:17:36Z] Processing calc submissions...
[2026-04-08T19:17:36Z] Check complete. Next run at 2026-04-08T16:17:EDT
[2026-04-08T20:00:00Z] Starting lead monitor check
[2026-04-08T20:00:00Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T20:00:00Z] Processing calc submissions...
[2026-04-08T20:00:00Z] Check complete. Next run at 2026-04-08T17:00:EDT
[2026-04-08T20:17:38Z] Starting lead monitor check
[2026-04-08T20:17:39Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T20:17:39Z] Processing calc submissions...
[2026-04-08T20:17:39Z] Check complete. Next run at 2026-04-08T17:17:EDT
[2026-04-08T21:00:00Z] Starting lead monitor check
[2026-04-08T21:00:01Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T21:00:01Z] Processing calc submissions...
[2026-04-08T21:00:01Z] Check complete. Next run at 2026-04-08T18:00:EDT
[2026-04-08T21:17:34Z] Starting lead monitor check
[2026-04-08T21:17:34Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T21:17:34Z] Processing calc submissions...
[2026-04-08T21:17:34Z] Check complete. Next run at 2026-04-08T18:17:EDT
[2026-04-08T22:00:00Z] Starting lead monitor check
[2026-04-08T22:00:01Z] ROI Calc submissions response: 7791 bytes
[2026-04-08T22:00:01Z] Processing calc submissions...
[2026-04-08T22:00:01Z] Check complete. Next run at 2026-04-08T19:00:EDT

View File

@@ -1,31 +1,7 @@
{
"processed_leads": [],
"processed_calc_ids": [
1,
2,
3,
4,
7,
6,
5
],
"last_check": "2026-04-08T10:30:23.552271",
"processed_calc_ids": [1, 2, 3, 4],
"last_check": "2026-04-08T22:00:01Z",
"status": "active",
"notes": "Hourly monitoring enabled. Next check in 60 minutes.",
"processed_roi": [
1,
2,
3,
4,
7,
6,
5
],
"processed_interest": [
5,
4,
3,
2,
1
]
}
"notes": "Hourly monitoring enabled. Next check in 60 minutes."
}

View File

@@ -2,86 +2,197 @@
Automated first-line support bot that triages customer conversations and escalates to Chris when needed.
## 🚀 Setup Instructions
## 🚀 Quick Start
### 1. Configure Chatwoot Bot
**Already configured?** Jump to [Production Deployment](#-production-deployment)
1. Go to **Settings → Bots** in your Chatwoot account
2. Click **Add Bot**
3. Fill in:
- **Name:** HOA Ledger IQ Bot
- **Avatar:** (optional upload logo)
- **Webhook URL:** `http://your-server-ip:3001/webhook` (or use ngrok for local testing)
4. Save and copy the **Bot Token**
### What This Bot Does
### 2. Connect Bot to Inbox
1. **Greets customers** automatically when they start a conversation
2. **Detects intent** (billing, technical issues, feature questions, account help)
3. **Searches FAQ knowledge base** for answers
4. **Escalates to Chris** when it can't help, with optional Telegram notifications
5. **Grows smarter** as you add more FAQ entries over time
1. Go to the inbox you want to use (e.g., website widget)
2. Click **Bot Configuration**
3. Select the bot you just created
4. Click **Save**
---
### 3. Get Your Chatwoot API Token
# 🏗️ Production Deployment
1. Go to your **Profile Settings** (click avatar)
2. Scroll to **API Token** section
3. Copy your token
Follow these steps to deploy the bot to your production server.
### 4. Configure the Bot
## Prerequisites
- Node.js installed on server (v14+)
- SSH access to production server
- Chatwoot instance running
- PM2 for process management (installed during deployment)
## Step-by-Step Deployment
### 1. SSH into Your Production Server
```bash
cd chatwoot-agent-bot
cp .env.example .env
ssh your-username@your-server-ip
# Example: ssh root@192.168.1.100
# Or: ssh ubuntu@support.hoaledgeriq.com
```
Edit `.env` with your values:
### 2. Clone the Repository
```bash
# Navigate to where you want the bot (e.g., /opt or ~/apps)
cd /opt
# Clone the repo
git clone https://git.sensetostyle.com/JoeBot/SupportBot.git
cd SupportBot
```
CHATWOOT_URL=https://your-chatwoot-instance.com
CHATWOOT_API_TOKEN=your_api_token
### 3. Install Dependencies
```bash
# Install Node.js dependencies
npm install --production
```
### 4. Configure Chatwoot Bot (If Not Already Done)
**In your Chatwoot instance:**
1. Go to **Settings → Bots**
2. Click **Add Bot**
3. Fill in:
- **Name:** `HOA Ledger IQ Bot`
- **Avatar:** (optional - upload logo)
- **Webhook URL:** Leave blank for now (we'll add it after deployment)
4. Click **Create**
5. **Copy the Bot Token** shown
**Connect bot to your inbox:**
1. Go to **Settings → Inboxes**
2. Click your website widget inbox
3. Find **Bot Configuration** or **Agent Bots**
4. Select **HOA Ledger IQ Bot** from dropdown
5. Click **Save**
**Get your Chatwoot API token:**
1. Click your **profile avatar** (top right)
2. Go to **Profile Settings**
3. Scroll to **API Token** section
4. Click **Generate Token** (or copy existing)
5. **Copy the API token**
### 5. Create the `.env` Configuration File
```bash
# Create .env file
nano .env
```
Paste this content (update with YOUR values):
```bash
# Chatwoot Configuration
CHATWOOT_URL=https://chat.hoaledgeriq.com
CHATWOOT_API_TOKEN=your_api_token_here
CHATWOOT_ACCOUNT_ID=1
TELEGRAM_BOT_TOKEN=optional_for_notifications
TELEGRAM_CHAT_ID=optional_for_notifications
BOT_WEBHOOK_TOKEN=your_bot_token_here
# Telegram Notifications (optional - leave empty for now)
TELEGRAM_BOT_TOKEN=
TELEGRAM_CHAT_ID=
# Server port
PORT=3001
```
### 5. Run the Bot
**Save:** `Ctrl+O`, then `Enter`, then exit with `Ctrl+X`
### 6. Install PM2 (Process Manager)
PM2 keeps your bot running 24/7 and restarts it if it crashes.
```bash
# Install dependencies (already done)
# npm install express body-parser axios dotenv
# Install PM2 globally
npm install -g pm2
# Start the bot
node index.js
# Start the bot with PM2
pm2 start index.js --name chatwoot-bot
# Make it start on server reboot
pm2 save
pm2 startup
```
### 6. Test It
The `pm2 startup` command will show you a `sudo` command - **copy and paste that command** to complete the setup.
### 7. Set Up Reverse Proxy (Nginx)
Your bot is running on port 3001, but needs to be publicly accessible.
**Install nginx:**
```bash
# Check health
curl http://localhost:3001/health
sudo apt update && sudo apt install nginx -y
```
# Test webhook (simulate conversation)
curl -X POST http://localhost:3001/webhook \
-H "Content-Type: application/json" \
-d '{
"event": "message_created",
"data": {
"conversation": {
"id": 123,
"meta": {
"sender": {
"name": "Test User"
}
}
},
"message": {
"content": "Hello, I need help with billing",
"message_type": "incoming"
}
**Create nginx config:**
```bash
sudo nano /etc/nginx/sites-available/chatwoot-bot
```
Paste this (replace `your-domain.com` with your actual domain):
```nginx
server {
listen 80;
server_name your-domain.com;
location /webhook {
proxy_pass http://localhost:3001/webhook;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}'
}
```
**Enable the site:**
```bash
sudo ln -s /etc/nginx/sites-available/chatwoot-bot /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
```
### 8. Update Chatwoot Webhook URL
Now that your bot is publicly accessible:
1. Go to **Settings → Bots** in Chatwoot
2. Click on **HOA Ledger IQ Bot**
3. Update **Webhook URL** to:
```
https://your-domain.com/webhook
```
4. Click **Save**
### 9. Test It!
1. Go to your website widget
2. Start a new conversation
3. Say "Hello" or "I need help with billing"
4. The bot should respond!
---
## 🔧 How It Works
### Conversation Flow
@@ -100,30 +211,16 @@ curl -X POST http://localhost:3001/webhook \
When bot can't help:
- Changes conversation status from `pending` to `open`
- Assigns to human agent queue
- Sends Telegram notification (if configured):
```
🔔 Support Escalation
Customer: John Doe
Reason: technical_issue
Conversation: 123
Jump in: [link to conversation]
```
- Sends Telegram notification (if configured)
### Knowledge Base
- Located at: `../FAQ-KB.md`
- Located at: `../FAQ-KB.md` (in the main workspace)
- Bot searches this doc for answers
- Organized by categories:
- Getting Started
- Billing & Pricing
- Features & Usage
- Technical & Integration
- Account Management
- Troubleshooting
- Organized by categories: Getting Started, Billing, Features, Technical, Account, Troubleshooting
- **To add new entries:** Edit `FAQ-KB.md` following the template format
**To add new entries:** Edit `FAQ-KB.md` following the template format.
---
## 🎯 Intent Detection
@@ -138,8 +235,59 @@ Current intents (easily expandable):
| `account` | account, login, password | Search KB or escalate |
| `unknown` | anything else | Ask clarifying questions |
---
## 📝 Useful PM2 Commands
```bash
# Check bot status
pm2 status
# View logs
pm2 logs chatwoot-bot
# Restart the bot
pm2 restart chatwoot-bot
# Stop the bot
pm2 stop chatwoot-bot
# View memory/CPU usage
pm2 monit
```
---
## 🐛 Troubleshooting
### Bot not responding?
- Check logs: `pm2 logs chatwoot-bot`
- Verify webhook URL is publicly accessible
- Check firewall allows port 80/443
- Test health endpoint: `curl https://your-domain.com/webhook`
### Can't connect to Chatwoot?
- Verify `CHATWOOT_URL` in `.env` is correct
- Check API token is valid
- Ensure server can reach your Chatwoot instance (no firewall blocking)
### Escalations not working?
- Verify API token has correct permissions
- Check account ID is correct
- Review Chatwoot conversation status flow
### Need to update code?
```bash
cd /opt/SupportBot
git pull
pm2 restart chatwoot-bot
```
---
## 📈 Next Steps / Enhancements
- [ ] Add Telegram notifications for escalation alerts
- [ ] Add conversation memory (context across messages)
- [ ] Integrate with actual FAQ database (not just markdown)
- [ ] Add confidence scoring for intent detection
@@ -149,32 +297,9 @@ Current intents (easily expandable):
- [ ] Rich interactive messages (buttons, cards)
- [ ] Integration with HOA Ledger IQ API for account lookups
## 🐛 Troubleshooting
**Bot not responding:**
- Check webhook URL is publicly accessible (use ngrok for local dev)
- Verify bot is connected to inbox
- Check bot logs for errors
**Escalations not working:**
- Verify API token has correct permissions
- Check account ID is correct
- Review Chatwoot conversation status flow
**Telegram notifications not sending:**
- Ensure bot token is valid
- Chat ID must be a number (get from @userinfobot)
- Bot must be started in chat first
## 📝 Logs
Bot logs to console. For production, consider:
- PM2 for process management
- Winston/Bunyan for logging
- Error tracking (Sentry)
---
**Maintained by:** Forge (Chris's SaaS Operations Bot)
**Version:** 1.0.0
**Last Updated:** 2026-04-01
**Maintained by:** Forge (Chris's SaaS Operations Bot)
**Version:** 1.0.0
**Last Updated:** 2026-04-01
**Repository:** https://git.sensetostyle.com/JoeBot/SupportBot.git

View File

@@ -1,9 +1,9 @@
# Self-Improving Heartbeat State
last_heartbeat_started_at: 2026-04-01T08:01:00Z
last_heartbeat_started_at: 2026-04-06T08:23:00Z
last_reviewed_change_at: 2026-03-26T12:20:00Z
last_heartbeat_result: HEARTBEAT_OK
## Last actions
- 2026-04-01 08:01Z: Heartbeat check - no changes in self-improving files since last review
- Sales-lead agent: Running normally, cron executing every hour
- Marketing-content agent: ⚠️ Cron job 'marketing-content-daily' is idle - no runs since Mar 26 08:33 EDT (6 days ago). Cron shows status 'idle' with no last run timestamp. Needs investigation.
- 2026-04-06 08:23Z: Heartbeat check - no changes in self-improving files since last review
- Sales-lead agent: Running normally, cron executed at 04:17 AM, new leads detected (john@example.com, jane@example123.com, smith@example.com)
- Marketing-content agent: ✅ Last run Apr 2 09:01 AM completed successfully. No new content since then.