How ace-ify/careva works
Careva is a Hindi/English voice health helpline for browser and phone callers. A caller joins a LiveKit session, speaks with the primary agent, and receives spoken guidance or a specialist handoff; the agent can look up facilities, schemes, medicines, and air quality, remember callers, and create human escalations. The frontend also exposes call and escalation views. Core backend relationships are supported by excerpts and the SOURCE INDEX; some additional README capabilities are documented but their implementation details were not sampled.
Main entry points: agent.py Careva agent · handoff.py Agent handoff · facilities.py Facility locator · db.py Caller and call records
Components 18
Caller access
- Voice session UI
frontend/components/app/app.tsx - Session token API
frontend/app/api/token/route.ts - LiveKit transport
Voice agents
- Careva agent
backend/src/agent.py - Clinic specialist
backend/src/clinic_specialist.py - Agent handoff
backend/src/handoff.py
Health services
- Facility locator
backend/src/facilities.py - Health knowledge search
backend/src/rag.py - Health data tools
backend/src/health_mcp_server.py - Public health APIs
Memory and follow-up
- Caller and call records
backend/src/db.py - Reminder dispatch
backend/src/outbound.py
Operations interface
- Admin dashboard
frontend/app/admin/page.tsx - Call analytics API
frontend/app/api/calls/route.ts - Escalation API
frontend/app/api/escalations/route.ts - Forget API
frontend/app/api/forget/route.ts
Other components
- Caller
- Phone network
Connections 23
- Caller → Voice session UI: starts session
- Voice session UI → Session token API: requests token
frontend/components/app/app.tsx - Session token API → LiveKit transport: issues credentials
frontend/app/api/token/route.ts - Caller → LiveKit transport: sends audio
- LiveKit transport → Careva agent: routes session
- Careva agent → LiveKit transport: returns speech
- Careva agent → Facility locator: queries facilities
backend/src/agent.py - Careva agent → Health knowledge search: searches guidance
backend/src/agent.py - Careva agent → Health data tools: requests health data
backend/src/agent.py - Facility locator → Public health APIs: queries registries
backend/src/facilities.py - Health data tools → Public health APIs: queries live data
backend/src/health_mcp_server.py - Careva agent → Caller and call records: reads and writes
backend/src/agent.py - Clinic specialist → Facility locator: looks up details
backend/src/clinic_specialist.py - Careva agent → Agent handoff: initiates transfer
backend/src/agent.py - Agent handoff → Clinic specialist: activates specialist
backend/src/handoff.py - Agent handoff → Careva agent: returns control
backend/src/handoff.py - Careva agent → Reminder dispatch: dispatches reminders
backend/src/agent.py - Reminder dispatch → LiveKit transport: dispatches call
backend/src/outbound.py - LiveKit transport → Phone network: connects calls
- Admin dashboard → Call analytics API: views analytics
- Admin dashboard → Escalation API: manages cases
- Call analytics API → Caller and call records: reads call data
frontend/app/api/calls/route.ts - Forget API → Caller and call records: removes caller data