Lightweight real-time voice agent orchestration in Docker — built to demonstrate the orchestration layer around voice AI (the gap between text/backend agents and production voice systems).
Runs local-first at zero cloud spend: MOCK_MODE=true (default) boots with no models, GPU, or mic. Flip to false + install requirements-real.txt for on-device STT/TTS via faster-whisper + Piper + Ollama.
- Orchestration state machine —
IDLE→LISTENING→TRANSCRIBING→THINKING→SPEAKING, with barge-in (user speech cancels TTS). - Persistent memory — session/project layers injected each turn ("relationship that compounds").
- LLM harness, not prompts — deterministic server-side guardrails.
- Cost + latency instrumentation — per-turn
e2e_latency_s, tokens, cost; asserts against the sub-1.5s target. - Vendor abstraction — STT/LLM/TTS are swappable with graceful degradation.
docker build -f backend/Dockerfile -t voice-bridge:latest .
docker run --rm -p 8000:8000 voice-bridge:latest
# health
curl http://localhost:8000/healthConnect to /ws, send JSON control frames:
{"type":"user_speech_start"} // barge-in trigger
{"type":"audio_end"} // end of user utterance -> transcribe + respondServer replies with transcript, response (with latency breakdown + meets_target), and state frames.
GET /health— status + mock flagGET /state— orchestrator stateGET /metrics— latency/cost snapshotGET /memory— injected memory summaryPOST /reset— clear session
pip install -r backend/requirements-real.txt
# have Ollama running with llama3.2
MOCK_MODE=false docker run --rm -p 8000:8000 -e MOCK_MODE=false voice-bridge:latest