Skip to main content

Knowledge > Products > Voice Agent > Care Agent Handoff

Care Agent Handoff

The voice agent uses a two-agent architecture. The Coordinator is the front door for all church calls. The Care Agent handles pastoral and emotional conversations. This document describes how the handoff between them works.

Why Two Agents, Not Four

The original design had four agents: Coordinator, Care, Stewardship, and Discipleship. This was reduced to two for practical reasons:

  1. LiveKit's multi-agent design: On LiveKit Cloud, the voice agent uses LiveKit's native handoff mechanism for multi-agent routing within a single call, not phone number switching. Having fewer agents simplifies the routing.

  2. Menu systems are universally hated: Phone tree menus ("Press 1 for prayer, press 2 for directions") were explicitly rejected. The caller speaks naturally and the Coordinator routes conversationally.

  3. Stewardship was absorbed: The Coordinator now handles giving/tithing directly using the send_giving_link tool. There was no need for a separate agent just for financial topics.

  4. Discipleship was deferred: Theological deep-dive conversations were not a launch priority and can be handled by the Coordinator's RAG context.

What Triggers a Handoff

The Coordinator transfers to the Care Agent when the caller shares:

  • Grief or loss (death of a loved one, miscarriage, divorce)
  • Prayer needs requiring pastoral sensitivity
  • Emotional distress (crying, anxiety, fear)
  • Family crisis (abuse, addiction, domestic conflict)
  • Suicidal ideation or self-harm (note: the TurnProcessor's moderation layer handles the initial crisis response with 988 Lifeline information; the Care Agent provides ongoing pastoral support)
  • Hospital or illness situations
  • Loneliness or isolation
  • Any topic where the caller needs to feel heard, not just informed

The Coordinator never silently transfers the caller. The flow is:

1. Caller shares something emotionally sensitive
Example: "My husband passed away last week and I just... I don't know what to do."

2. Coordinator empathizes FIRST (HEAR protocol)
Example: "I'm so sorry for your loss. That must be incredibly difficult."

3. Coordinator asks for consent
Example: "Would it be okay if I switch to our Care mode so I can
give you my full attention?"

4a. Caller agrees → Coordinator calls transfer_to_care tool
LiveKit switches the active agent. The caller hears a different
voice (opposite gender), signaling the shift to pastoral care.

4b. Caller declines → Coordinator continues handling it directly using
HEAR protocol. Does NOT ask again.

5. Care Agent introduces itself (on_enter)
The Care Agent greets warmly in its own voice:
"Hi, I'm here with you now. Take your time — what's on your heart?"
This plays immediately after the handoff, preventing an awkward
silence gap.

The tool description that guides the Coordinator's decision:

"Transfer to pastoral care mode when the caller shares grief, loss, prayer needs, emotional distress, pastoral care needs, or sensitive personal topics. IMPORTANT: Before calling this tool, you MUST have already: 1. Empathized with the caller (HEAR protocol), 2. Asked if they would like to switch, 3. Received a YES or affirmative response."

What Changes on Handoff

AspectCoordinatorCare Agent
LLMGemini 2.5 FlashClaude Haiku 4.5
LLM FallbackClaude Haiku 4.5Gemini 2.5 Flash
Temperature0.7 (more creative/natural)0.4 (more controlled for sensitive topics)
FramingHelpful church receptionist"Be Christ to this person"
VoiceSession voice (Carson or Cindy)Opposite gender — if Coordinator is Carson (male), Care is Cindy (female), and vice versa. Churches can override with care_voice_id.
Available toolsFull toolset (visitor capture, directions, events, giving, appointments, PCO, etc.)Reduced: prayer_request, callback, end_call only
Handoff capabilityCan transfer to CareCannot transfer back to Coordinator

Voice Switching Mechanics

The voice switch is implemented via LiveKit's per-agent TTS override. Each Agent class can set tts="cartesia/sonic-3:<voice_id>" in its constructor, and LiveKit automatically switches the voice when that agent becomes active. No session.update_config() call is needed.

The get_opposite_voice() function in config.py maps:

  • Carson (male) 86e30c1d-... -> Cindy (female) 1242fb95-...
  • Cindy (female) 1242fb95-... -> Carson (male) 86e30c1d-...
  • Custom/unknown voice -> Carson (male) as default (since most custom voices are female receptionists)

The Coordinator's resolved voice_id is set by entrypoint() in main.py after random voice selection, and passed to CareAgent via the coordinator_voice_id parameter during handoff.

Why Claude Haiku for Care

Claude Haiku 4.5 was chosen as the Care Agent's primary LLM because it consistently demonstrates better empathy, more careful word choice, and more appropriate pacing in sensitive conversations compared to Gemini Flash. The temperature is lowered to 0.4 to reduce the risk of the model generating an ill-considered phrase during a vulnerable moment.

Why the Tool Set Is Reduced

The Care Agent has only four tools:

  1. submit_prayer_request -- The most common action during a pastoral call. Saves the prayer to the database and notifies the prayer team via email. Background tool: survives barge-in and gives intermediate status messages.

  2. request_callback -- Schedules a callback from the pastor or staff. Supports urgency levels (normal, urgent, pastoral_emergency). Background tool: sends email notifications and urgent SMS.

  3. send_sms_link -- Texts a link to the caller (e.g., grief resources, church website). Generic tool from core/tools.py.

  4. end_call -- Gracefully ends the call. Important: the caller always has the option to end, and the agent uses this tool when the conversation reaches a natural conclusion.

The Care Agent does not have visitor capture, event registration, directions, giving, appointment booking, or PCO integration tools. These are informational/transactional tasks that belong to the Coordinator. If someone asks for directions during a Care conversation, the agent can provide them verbally from RAG context, but the full toolset is intentionally absent to keep the Care Agent focused on pastoral support.

Care Agent Never Hands Back

Once a caller is transferred to Care, the call stays with Care until it ends. There is no "transfer back to Coordinator" tool. This is intentional:

  • Bouncing a vulnerable caller between agents would feel impersonal
  • The Care Agent can answer most follow-up questions from RAG context
  • If the caller has a completely separate transactional need, they can call back
  • The farewell detection and call ending work the same way in both agents

Tier Gating

The Care Agent handoff is gated by the church's plan tier. The TIER_AGENTS configuration in verticals/church/config.py defines which agents are available per tier:

starter: ["care", "coordinator"]
pro: ["care", "coordinator"]
suite: ["care", "coordinator"]

Currently all tiers include Care. If a tier did not include "care" in its TIER_AGENTS list, the transfer_to_care tool would not be added to the Coordinator, and the Coordinator would handle pastoral topics directly (less ideal but functional).

If building the Care Agent fails for any reason (e.g., missing API key), the system logs a warning and the Coordinator handles all topics without the handoff tool. The call is never dropped due to a Care Agent build failure.

How This Differs from the Chatbot

The chatbot (churchwiseai-web/src/app/api/chatbot/stream/route.ts) has its own agent routing system but it works differently:

  • Chatbot agents are defined in organization_settings.agent_config
  • Chatbot routing is per-message, not per-session handoff
  • The chatbot does not have a "Care" agent equivalent in the same way -- it uses prompt-based persona switching rather than a full agent swap
  • The voice agent's handoff is more dramatic because it changes the LLM, temperature, tools, and conversational framing mid-call

Crisis vs. Care: Two Different Paths

It is important to distinguish between the crisis moderation path and the Care Agent path:

AspectCrisis (TurnProcessor)Care (Agent Handoff)
TriggerRegex pattern match on suicidal/self-harm languageCoordinator's LLM judgment about emotional context
ResponseImmediate 988 Lifeline injection, bypasses normal flowWarm, consent-based transfer to pastoral support
Auto-hangupDisabled (caller controls when to end)Normal farewell detection still active
NotificationsCrisis alert emails + SMS to church and supportNormal tool notifications (prayer, callback)
SpeedInstant (regex, no LLM needed)Natural conversation pace (LLM decides)

Both can be active in the same call. A caller might trigger crisis moderation first (getting the 988 number), then have the Coordinator offer a Care handoff for ongoing pastoral support. The crisis flag disables auto-hangup for the remainder of the call.