API: Care Agent Configuration and Behavior
Property: ChurchWiseAI Category: API / Integration
Tier:
pro-both
Persona: developer
Touchpoint: /api/admin/care-agent, /api/chatbot/stream
Preconditions
- Care Agent feature enabled
- Test church has Care Agent configured
Steps
| # | Action | Expected Result |
|---|---|---|
| 1 | GET /api/admin/care-agents for church | Returns JSON array of care agents. Includes personality, escalation rules, etc. |
| 2 | POST /api/admin/care-agents to create new agent | Returns 201. New agent has ID and all provided properties. |
| 3 | POST /api/chatbot/stream with agentType=care | Routes to Care Agent. Response uses care/pastoral tone. Escalation keywords detected. |
| 4 | Send crisis keywords to Care Agent (suicide, abuse, harm) | Detects escalation trigger. Flags for pastor follow-up. Responds with empathy. |
| 5 | Send prayer request to Care Agent | Acknowledges request. Captures prayer detail. Flags for prayer team. |
| 6 | PUT /api/admin/care-agents/{id} to update personality | Agent config updated. New responses reflect updated personality. |
| 7 | DELETE /api/admin/care-agents/{id} | Agent deleted. Returns 204. Agent no longer available for routing. |
Known Failure Modes
- Care Agent routes to wrong model — wrong tone/behavior
- Escalation keywords not detected — crisis not flagged
- Prayer requests not captured — pastoral follow-up missed
- Agent deletion doesn't prevent routing — ghost agent still active
References
- Playwright spec:
e2e (care agent integration) - Code files:
Notes
Tests Care Agent API and behavior. Care Agent is specialized for sensitive pastoral conversations. Must detect crisis keywords, capture prayer requests, and route appropriately. Failures mean pastors miss urgent needs (safety issue).