How yar-malik/voho-hospital-voice-agent works
This is a hospital voice-assistant demo: callers speak or type, the server transcribes audio when needed, and the turn handler sends the conversation to Voho. The Voho adapter interprets tool markers and dispatches hospital tools; the answer is then synthesized and returned to the browser. The main domain stages are emergency handling, appointment operations, clinic transfer, and information delivery, supported by hospital configuration and a factual knowledge base. Several tool implementations and UI details were not excerpted, so their internal calls are omitted; documented capabilities remain represented.
Main entry points: VoiceDemo.tsx Voice demo · index.ts Tool registry · hospital.ts Hospital configuration · route.ts Turn endpoint
Components 23
Caller experience
- Demo page
app/page.tsx - Voice demo
components/VoiceDemo.tsx - Audio capture
lib/audio/record.ts - Transcript view
components/Transcript.tsx - Tool log
components/ToolLog.tsx
Conversation server
- Turn endpoint
app/api/voice/turn/route.ts - Transcription endpoint
app/api/voice/transcribe/route.ts - Status endpoint
app/api/status/route.ts - Agent brief
lib/agentPrompt.ts
Hospital capabilities
- Hospital knowledge
lib/knowledge/index.ts - Hospital configuration
config/hospital.ts - Tool registry
lib/tools/index.ts - Emergency escalation
lib/tools/escalateEmergency.ts - Appointments
lib/tools/appointments.ts - Clinic transfer
lib/tools/transferToClinic.ts - Information delivery
lib/tools/sendInformation.ts
Voho integration
- Tool-call adapter
lib/voho/tools.ts - Agent replies
lib/voho/agents.ts - Speech synthesis
lib/voho/speech.ts - Speech recognition
lib/voho/transcribe.ts - API client
lib/voho/client.ts
Other components
- Caller
- Voho service
Connections 30
- Caller → Voice demo: speaks or types
components/VoiceDemo.tsx - Demo page → Voice demo: renders
app/page.tsx - Voice demo → Audio capture: records audio
components/VoiceDemo.tsx - Voice demo → Transcription endpoint: posts audio
components/VoiceDemo.tsx - Voice demo → Turn endpoint: posts turn
components/VoiceDemo.tsx - Voice demo → Transcript view: renders
components/VoiceDemo.tsx - Voice demo → Tool log: renders
components/VoiceDemo.tsx - Turn endpoint → Tool-call adapter: handles turn
app/api/voice/turn/route.ts - Turn endpoint → Agent brief: loads brief
app/api/voice/turn/route.ts - Turn endpoint → Hospital configuration: uses settings
app/api/voice/turn/route.ts - Transcription endpoint → Speech recognition: transcribes audio
app/api/voice/transcribe/route.ts - Status endpoint → Hospital configuration: reports settings
app/api/status/route.ts - Status endpoint → Hospital knowledge: checks demo data
app/api/status/route.ts - Status endpoint → Tool registry: lists tools
app/api/status/route.ts - Tool-call adapter → Agent replies: requests replies
lib/voho/tools.ts - Tool-call adapter → Tool registry: runs requested tool
lib/voho/tools.ts - Tool-call adapter → Speech synthesis: synthesizes answer
lib/voho/tools.ts - Agent replies → API client: makes API calls
lib/voho/agents.ts - Speech synthesis → API client: makes API calls
lib/voho/speech.ts - Speech recognition → API client: uploads audio
lib/voho/transcribe.ts - API client → Voho service: calls API
lib/voho/client.ts - Tool registry → Emergency escalation: dispatches
lib/tools/index.ts - Tool registry → Appointments: dispatches
lib/tools/index.ts - Tool registry → Clinic transfer: dispatches
lib/tools/index.ts - Tool registry → Information delivery: dispatches
lib/tools/index.ts - Agent brief → Hospital knowledge: uses facts
README.md - Agent brief → Tool registry: describes tools
README.md - Hospital knowledge → Hospital configuration: reads hospital facts
lib/knowledge/index.ts - Emergency escalation → Hospital configuration: uses emergency settings
lib/tools/escalateEmergency.ts - Appointments → Hospital configuration: checks clinic rules
lib/tools/appointments.ts