Skip to main content

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

  1. Crisis call arrives — Standard greeting, standard STT. No special handling yet. Call timestamped and recorded normally.

  2. STT captures crisis language — Deepgram transcribes with keyterms boost for crisis vocabulary. All words captured exactly; no filtering.

  3. 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."

  4. Crisis detection triggersafety.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.

  5. 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.

  6. Callback request captured — Caller shares their phone number. Written to voice_callback_requests with request_type='crisis_escalation', urgency='crisis', status='pending_human_followup', and full transcript. Write happens in verticals/church/tools.py:add_callback_request().

  7. Crisis safety net injectionsafety.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.

  8. Founder alert + pastor notificationcore/notifications.py:sendCrisisAlert() emails founder (P0) and pastor's escalation_contact_email in 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:

  1. Agent listens without interruption; caller finishes their thought.
  2. Agent believes them: "That's real, and I believe you."
  3. Agent does NOT offer solutions, pray, or advise.
  4. Agent bridges quickly: "I'm connecting you with a pastor."
  5. Caller's phone number is captured and repeated back to confirm.
  6. Caller hears 988, 741741, and 911 before call ends.

From the pastor's point of view:

  1. Alert arrives within 2 seconds of escalation with caller's phone number.
  2. Transcript excerpt shows the exact triggering words.
  3. Dashboard marks crisis calls with a red "CRISIS" badge.

Known failure modes

  • Crisis regex disabled or deleted. If detect_crisis() is removed or returns False unconditionally, 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_PROMPT explicitly forbids prayer, advice, and solutions. Agent's job is listen, believe, bridge to human.

  • Callback request never reaches pastor. If escalation_contact_email is 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_sent flag on the call record to prevent re-notification on retry. Same call should never generate multiple P0 alerts.