System Architecture
Inbound · Intake · Routing · Async · System of RecordFacebook Messenger
Instagram DMs
Website Form
Inbound Channels
→
/webhook/meta
Meta Graph API · HMAC verified
/webhook/inquiry
Website form · Token verified
Webhook Gateway
→
Agent 1
Lead Intake
Qualifies <60s · Brand-aware
→
Agent 3CRM Pipeline
Agent 2Appointment
Agent 6Slack Alerts
Routes to (parallel)
↓
↓
Agent 4Follow-Up
← Close webhook + 9 AM cron
Agent 5Voice
← Vapi post-call webhook
Triggered async
→
Close CRM
System of Record
Single source of truth
System At a Glance
LiveTotal Agents
6
All operational
PLAD Leads
—
Loading...
Suofeiya Leads
—
Loading...
AI Model
Sonnet 4.6
claude-sonnet-4-6
System Metrics
Lifetime totals across all agentsLeads Created
—
this week
Slack Alerts Sent
—
all-time total
Webhooks Received
—
all-time total
Integration Health
Live status of every external system the agents depend onFacebook Messenger
—
checking...
Meta Webhook
—
checking...
Close CRM
—
checking...
Slack
—
checking...
Vapi Voice
—
checking...
Claude (Anthropic)
—
checking...
Manual Triggers
On-demand re-runs for any cron-scheduled jobInbox Sweeps
Reports & Briefings
Lead Nurture & Quality
Today's Pulse
Live activity across the systemNew Leads Today
—
across all pipelines
Leads This Week
—
last 7 days
AI Follow-Ups
—
today · PLAD + Suofeiya
Loading week…
Active Conversations
—
in-memory sessions
Server Uptime
—
since last deploy
Active Agents
Select an agent card on Overview, or press 1–6 to load a test form.
LIVE
Connecting to log stream...
Agent Configuration
Changes apply immediately — no restart required. Disabled agents skip execution on next trigger.
Loading agent config...
Agent Run Stats
Agent 1
—
runs
Agent 2
—
runs
Agent 3
—
runs
Agent 4
—
runs
Agent 5
—
runs
Agent 6
—
runs
Pipeline Diagram
1 · Lead Intake
Meta + Website
→
2 · Appt Setter
SMS & Email booking
→
3 · CRM Pipeline
Close CRM writes
→
4 · Follow-Up
Outbound + Cron 9AM ET
→
5 · Voice
Vapi post-call
→
6 · Slack Alerts
#leads-plad / #leads-suofeiya
Webhook Endpoints
| Method | Endpoint | Consumer | Auth | Description |
|---|---|---|---|---|
| POST | /webhook/meta | Agent 1 | HMAC | Facebook Messenger + Instagram DMs (primary inbound) |
| GET | /webhook/meta | Server | Token | Meta webhook subscription verification handshake |
| POST | /webhook/inquiry | Agent 1 | Token | Website inquiry form submissions |
| POST | /webhook/close | Agents 4,6 | HMAC | Close CRM lead/opportunity events |
| POST | /webhook/vapi | Agent 5 | Secret | Vapi post-call summary webhook |
| POST | /webhook/vapi/assistant-request | Server | Secret | Vapi inbound call routing (weekend mode) |
Manual Triggers (require x-edit-key) | ||||
| POST | /api/morning-brief | Server | Key | Per-rep DM with tasks + assigned hot leads |
| POST | /api/daily-briefing | Server | Key | Per-brand 9 AM channel post (PLAD + Suofeiya). ?clearDedup=1 to re-send |
| POST | /api/weekly-recap | Server | Key | Weekly Close CRM activity report → #team-sales + Eli + Scott |
| POST | /api/hot-lead-nudge | Server | Key | DM reps about Hot/Potential leads idle 48h+ |
| POST | /api/patch-note | Server | Key | Post engineering patch note / brief to #ai-patchnotes |
| Dashboard / Internal | ||||
| POST | /api/tools/edit-prompt | External | Key | Edit agent system prompt via API |
| GET | /api/agents/config | Dashboard | Basic | Get all agent configs |
| POST | /api/agents/:id/config | Dashboard | Basic | Update single agent config |
| GET | /api/agents/:id/prompt | Dashboard | Basic | View agent system prompt |
| POST | /api/agents/reset-config | Dashboard | Basic | Reset all agent configs to defaults |
| GET | /api/agents/status | Dashboard | Basic | Per-agent enabled/run status |
Cron Schedule
| Time (ET) | Day | Agent | Action |
|---|---|---|---|
| 9:00 AM | Mon–Fri | Agent 4 | Inactive lead follow-up sweep + morning briefing + NDA follow-up |
| 11:00 AM | Mon–Fri | Agent 1 | Phoneless nurture sweep (re-engage silent Facebook leads) |
| 1:00 PM | Daily | Server | Mid-shift check-in (new leads + stuck leads → Slack) |
| 3:00 PM | Mon–Fri | Agent 1 | Phoneless nurture sweep (second pass) |
| 4:00 PM | Daily | Server | Pre-EOD prep (open tasks + wrap-up nudge → Slack DMs) |
| 7:00 PM | Friday | Server | Weekly performance report → Scott DM |
| 6:00 AM | Monday | Server | Cold lead archive sweep (90+ days inactive) |
| 9:00 AM | Monday | Server | Weekly sales recap → #team-sales + Eli + Scott |
| Every 15 min | Daily | Agent 1 | Meta inbox sweep (unreplied Facebook messages) |
| 11:45 PM | Daily | Server | EOD WhatsApp session flush → Close CRM notes |
Environment Variables
Vapi Setup
Post-Call Webhook
Configure in Vapi dashboard → Assistant → Server URL
loading...
Assistant Request URL
Routes inbound calls. Configure in Vapi → Squad / Phone Number → Server URL
loading...
Weekend Routing Model
Active Sat & Sun — routes to after-hours prompt instead of live agent squad
claude-haiku-4-5-20251001
System Info
Node.js Runtime
loading...
Server Uptime
loading...
API Config File
agent-config.json
Server Port
3000
Module System
ES Modules (type: module)
Agent 5 Dead-Letter Queue
Vapi webhooks missing
lead_id are queued here for manual recovery.Loading...
Agent 1 — Behavior Rules
Priority Goals
- Collect phone number first (top priority)
- Collect email address (secondary)
- Create lead in Close CRM with any info gathered
- Notify Slack on every new lead
Lead Creation Rules
- Phone alone → create lead immediately
- 3+ exchanges without phone → create partial lead
- Check for existing lead before creating new
- Assign to team if phone provided
Conversation Style
- Warm, helpful, never pushy
- Short messages (2–3 sentences max)
- Answer product questions via Gemini RAG
- Sweep re-engagements: warm reconnect tone
Facebook Messaging Windows
- < 23h → standard reply
- 23h–7d → HUMAN_AGENT tag
- > 7d → cannot reply (FB policy)
- Inbox sweep runs every 15 min
PLAD Homes — Product Knowledge
This text is injected into Agent 1's Gemini RAG context when answering PLAD product questions. Edit freely — changes take effect within 10 seconds, no deploy needed.
Suofeiya USA — Product Knowledge
This text is injected into Agent 1's Gemini RAG context when answering Suofeiya product questions. Edit freely — changes take effect within 10 seconds, no deploy needed.
Sales Performance
Dials
—
Outbound calls
Emails Out
—
Emails sent
SMS Sent
—
Outbound texts
Open Tasks
—
Team pending
Overdue
—
Past due date
Total Activity
—
Calls + email + SMS
B
Berel Gurary
Sales Rep · PLAD Homes
—%
—
Dials
—
Emails
—
SMS
—
Pending
—
Overdue
P
Paul Arceo
Sales Rep · PLAD Homes
—%
—
Dials
—
Emails
—
SMS
—
Pending
—
Overdue
CRM Cleanup
Reassign Eli's Open Leads
Finds all open PLAD & Suofeiya opportunities currently assigned to Eli and redistributes them evenly between Berel and Paul. Won/Lost deals are skipped. Each reassignment is logged as a CRM note.