How piiyush-joshii/voice-bot-v2 works
This repository is a local voice-and-text electronic bill presentment and payment (EBPP) proof of concept. A web caller starts a session; the voice agent handles text or audio turns, authenticates the account, answers bill/history questions, and can initiate payment or hand off to a human. Card entry is isolated in a separate payment service, with payment outcomes returned to the conversation. The graph follows documented capabilities and shown call paths; links to unsampled subsystem internals are kept at service level.
Main entry points: pipeline.py Audio Pipeline · conversation.py Turn Orchestrator · routes.py Voice API · App.tsx Console App
Components 25
Web Console
- Console App
web/src/App.tsx - Backend Client
web/src/api/backend.ts - Session Client
web/src/api/sessions.ts - Voice WebRTC
web/src/voice/webrtc.ts
Voice Agent
- Voice API
services/voice-agent/app/api/routes.py - Session Registry
services/voice-agent/app/sessions.py - Audio Pipeline
services/voice-agent/app/pipeline.py - ASR and TTS
services/voice-agent/app/services/speech.py - Transcript Scrubber
services/voice-agent/app/processors/scrubber.py - Pipeline Metrics
services/voice-agent/app/processors/metrics.py - Payment Gate
services/voice-agent/app/gate/state.py
Conversation Brain
- Turn Orchestrator
services/voice-agent/app/brain/conversation.py - Intent and FAQ Router
services/voice-agent/app/processors/router.py - LLM Service
services/voice-agent/app/services/llm.py - Conversation Tools
services/voice-agent/app/brain/tools.py - Service Clients
services/voice-agent/app/clients.py
Billing API
- Billing Routes
services/backend-api/app/routes/bills.py - Authentication Routes
services/backend-api/app/routes/auth.py - Payment Records
services/backend-api/app/routes/payments.py - Mock Account Store
services/backend-api/app/mock_data.py - Notifications
services/backend-api/app/routes/notifications.py
PCI Payment
- PCI Capture Service
services/payment-service/app/main.py - Secure Capture UI
services/payment-service/app/static/capture.js - Payment Webhook
services/payment-service/app/webhook.py
Other components
- Caller
Connections 29
- Caller → Console App: uses
README.md - Console App → Backend Client: fetches bills
web/src/App.tsx - Console App → Session Client: creates sessions
web/src/App.tsx - Console App → Voice WebRTC: starts voice
web/src/App.tsx - Session Client → Voice API: HTTP sessions
- Voice WebRTC → Voice API: WebRTC
- Backend Client → Billing Routes: requests bills
- Voice API → Session Registry: looks up sessions
services/voice-agent/app/api/routes.py - Voice API → Turn Orchestrator: handles turns
services/voice-agent/app/api/routes.py - Voice API → Audio Pipeline: builds voice task
services/voice-agent/app/api/routes.py - Audio Pipeline → ASR and TTS: builds ASR and TTS
services/voice-agent/app/pipeline.py - Audio Pipeline → Transcript Scrubber: scrubs transcripts
services/voice-agent/app/pipeline.py - Audio Pipeline → Payment Gate: gates capture
services/voice-agent/app/pipeline.py - Audio Pipeline → Pipeline Metrics: taps pipeline
services/voice-agent/app/pipeline.py - Audio Pipeline → Turn Orchestrator: runs turns
services/voice-agent/app/pipeline.py - Turn Orchestrator → Intent and FAQ Router: routes intent
services/voice-agent/app/brain/conversation.py - Turn Orchestrator → LLM Service: requests decisions
services/voice-agent/app/brain/conversation.py - Turn Orchestrator → Conversation Tools: executes tools
services/voice-agent/app/brain/conversation.py - Turn Orchestrator → Payment Gate: checks gate state
services/voice-agent/app/brain/conversation.py - Conversation Tools → Service Clients: uses service clients
- Service Clients → Billing Routes: calls billing API
services/voice-agent/app/clients.py - Service Clients → PCI Capture Service: creates payment session
services/voice-agent/app/clients.py - Billing Routes → Mock Account Store: reads bill data
services/backend-api/app/routes/bills.py - Authentication Routes → Mock Account Store: checks account
services/backend-api/app/routes/auth.py - Payment Records → Mock Account Store: records payment
services/backend-api/app/routes/payments.py - PCI Capture Service → Secure Capture UI: serves capture UI
- PCI Capture Service → Payment Webhook: sends event
services/payment-service/app/main.py - Payment Webhook → Voice API: posts payment event
- Conversation Tools → Notifications: sends receipt notice