Crisis call escalation — visitor in emotional distress
Persona
A caller in acute distress — suicidal ideation, domestic violence, homelessness, severe loneliness, or spiritual despair. They are NOT looking for AI advice. They called because a human cares. The AI's job is to listen, believe them, and get them to a human pastor immediately. Nothing more.
Entry points
- Any hour: Voice agent answers 24/7 — many crisis calls come after hours when offices are closed.
- Cold call from search: Caller found the church on Google or PewSearch and dialed the only number they found.
Click-through flow
Steps
-
Crisis call arrives — Standard greeting, standard STT. No special handling yet. Call timestamped and recorded normally.
-
STT captures crisis language — Deepgram transcribes with keyterms boost for crisis vocabulary. All words captured exactly; no filtering.
-
LLM processes with crisis awareness — Claude Haiku 4.5 receives STT text with HEAR system prompt. Agent constructs a response focused on hearing and believing the caller. System prompt: "Never offer advice, prayer, or counseling. Acknowledge their pain. Tell them you're connecting them to a pastor."
-
Crisis detection trigger —
safety.py:detect_crisis()runs deterministic regex on the caller's transcribed text (not the agent's response). Example patterns:\b(suicid|kill myself|hurt myself|hanging|overdose|end it all)\b,\b(abuse|hitting|controlling|trapped)\b. If ANY pattern matches, crisis flag is set. This is hardcoded pattern matching (not ML) — 100% reliable unless the code is removed. -
Coordinator → Care agent handoff — Handoff is deterministic; no intermediate question. Care agent's voice enters (opposite gender). Care agent says: "I hear what you're going through. That sounds incredibly hard. I'm here with you right now. Can I have your phone number so [Pastor Name] can reach you in just a few minutes?" Care agent NEVER offers spiritual advice, prays unprompted, or minimizes pain.
-
Callback request captured — Caller shares their phone number. Written to
voice_callback_requestswithrequest_type='crisis_escalation',urgency='crisis',status='pending_human_followup', and full transcript. Write happens inverticals/church/tools.py:add_callback_request(). -
Crisis safety net injection —
safety.py:apply_crisis_safety_net()checks the assembled response for 988, 741741, or 911. If missing, injects: "If you're in immediate danger, please call 988 (Suicide & Crisis Lifeline), text 741741 (Crisis Text Line), or call 911. You matter. Help is available." This runs on every response and cannot be disabled. -
Founder alert + pastor notification —
core/notifications.py:sendCrisisAlert()emails founder (P0) and pastor'sescalation_contact_emailin parallel within 2 seconds. Both emails include caller phone, transcript excerpt, church name, and link to full transcript in dashboard.
Acceptance spec
Canonical: knowledge/acceptance/starter-voice.md (Care agent, crisis safety, escalation touchpoints).
Critical requirement: Crisis protocol is NOT optional, NOT tier-gated, NOT feature-flagged. ALL voice plans (Starter, Pro) must detect and escalate crisis calls. This is a legal and ethical hard requirement.
Success criteria
From the caller's point of view:
- Agent listens without interruption; caller finishes their thought.
- Agent believes them: "That's real, and I believe you."
- Agent does NOT offer solutions, pray, or advise.
- Agent bridges quickly: "I'm connecting you with a pastor."
- Caller's phone number is captured and repeated back to confirm.
- Caller hears 988, 741741, and 911 before call ends.
From the pastor's point of view:
- Alert arrives within 2 seconds of escalation with caller's phone number.
- Transcript excerpt shows the exact triggering words.
- Dashboard marks crisis calls with a red "CRISIS" badge.
Known failure modes
-
Crisis regex disabled or deleted. If
detect_crisis()is removed or returnsFalseunconditionally, suicidal callers hear a standard response. P0 incident. Unit test:assert detect_crisis("I'm going to hurt myself") == True. -
Care agent offers counsel or prayer. Verify
verticals/church/prompts.py:CARE_AGENT_SYSTEM_PROMPTexplicitly forbids prayer, advice, and solutions. Agent's job is listen, believe, bridge to human. -
Callback request never reaches pastor. If
escalation_contact_emailis null (not set during onboarding), alert is sent to an invalid address. Require the field during wizard Step 4 — make it non-skippable. -
Safety net hotlines injected mid-sentence.
apply_crisis_safety_net()must append to response end, not mid-sentence. Verify TTS receives complete response including hotlines before voice is generated. -
Duplicate crisis alerts from retries. Use a
crisis_alert_sentflag on the call record to prevent re-notification on retry. Same call should never generate multiple P0 alerts.