Internal R&D•Telephony & Multimodal AI

Real-Time AI Phone Agent

A bilingual AI phone agent for real-time conversations, built with Twilio Media Streams, Google Gemini Live, and Cloud Run. It streams full-duplex audio, captures leads, and supports SIP phone transfers.

Bidi Stream
Full-Duplex Audio
Real-time WebSocket streaming
Instant Context
In-Prompt Knowledge Base
Zero intermediate retrieval hops
Twilio + GCP
Cloud Infrastructure
Twilio Media Streams & Cloud Run
Scale-to-Zero
Serverless Compute
Zero active containers when idle

Try Live Voice AI in Browser

Voice powered by Gemini Live

Twilio Telephony & Gemini Live Multimodal Pipeline

Inbound phone calls stream telephony audio via Twilio Media Streams WebSockets into a lightweight Google Cloud Run container. A pure-software audio codec decodes G.711 μ-law audio, upsamples the stream in-memory, and feeds Gemini Live over a persistent bidirectional WebSocket session. The model delivers streaming conversational speech with natural barge-in interruption detection, while executing autonomous lead capture to Firestore and Slack, alongside warm SIP transfers to desk phones.

1. Inbound Twilio Streaming

Secure call ingestion over full-duplex WebSockets with Twilio cryptographic signature validation.

2. In-Flight Audio Transcoding

Fast lookup-table expansion and linear resampling between Twilio 8kHz and Gemini Live sample rates.

3. Gemini Live Inference

Continuous bidirectional audio loop with automatic language detection and conversational flow.

4. Voice Activity & Interruption Handling

Instant buffer purging flushes queued Twilio playback the moment the caller speaks.

5. Firestore, Slack & SIP Dispatch

Executes lead capture to Firestore & Slack, and issues live SIP call redirection to desk phones via Twilio REST API.

Direct In-Prompt Knowledge & Grounding

  • Direct Context Ingestion: Embeds company services and technical project case studies directly into system instructions, avoiding external database retrieval hops.
  • Spoken-Word Phone Guardrails: Restricts output formatting to natural conversational dialogue, preventing URLs, markdown, and list formatting from entering audio streams.

Pure-Software Audio Codec

  • Zero Native Dependencies: In-memory G.711 μ-law lookup tables and linear resampling (8kHz ↔ 16kHz ↔ 24kHz) running in pure TypeScript without ffmpeg or C++ binaries.
  • Twilio Frame Pacing: Packages outbound synthesized audio into uniform 20-millisecond chunks matching telephony stream timing specifications.

Barge-In Synchronization & Buffer Clearing

  • Immediate Playback Flushing: Listens for Gemini Live interruption events and immediately emits a Twilio clear signal to purge queued audio buffers.
  • Zero Audio Collisions: Prevents synthetic speech from talking over callers when they interrupt.

Telephony Routing & Enterprise Leads

  • Live SIP Warm Transfer: Triggers call redirects via Twilio REST API to route callers to an IP desk phone, with automated voicemail fallback.
  • Dual Lead Dispatch: Executes tool calls to persist structured lead data in Firestore and send real-time Block Kit alerts to Slack.
Execution Artifact · Voice Lead Notification
Live Webhook Output
AI
Cubog Voice AssistantAPP · Today at 2:18 PM
📞 New Voice Lead Captured via Phone Hotline!
Client NameMarcus Vance
Emailmarcus@vancetech.io
TimelineNext 30 Days (Immediate)
Budget$20,000 – $40,000
Caller ID+1 (Verified Caller)
“Looking to modernize an existing call center IVR with a bilingual conversational AI agent that can query PostgreSQL and warm-transfer callers to desk phones.”
Verified Voice Lead · Transcribed & Dispatched to Team Channel
Telephony Audio Pipeline · Bidirectional Flow
In-Memory Transcoding
Inbound Telephony Audio Stream
Telephony Stream (8 kHz compressed voice) → Lookup-table expansion → Linear audio upsampled to 16 kHz.
✓ In-memory linear expansion without external multimedia binaries.
Outbound Multimodal Synthesis
Model Output (24 kHz linear audio) → Downsampled to 8 kHz → Re-encoded to telephony format in 20ms frames.
✓ Interruption-aware: immediately cleared if caller voice activity is detected.
Interactive Telephony Demo

Interested in Autonomous Voice AI?

We build production-ready voice and multimodal agent systems with sub-second latency, custom telephony integrations, and enterprise database grounding. Get in touch to schedule a live demo or technical walkthrough.

Book 30-Min Call
Cubog SoftwareCubog Software

Miami software engineering company and consultancy. Building production-grade web, mobile, and backend systems.

© 2026 Cubog Software. All rights reserved.