CXB Core is a FastAPI-based voice pipeline worker built on the media pipeline framework. It accepts inbound and outbound calls through telephony adapters, runs a real-time speech pipeline, uploads recordings, and delivers structured results back to CXB API.

How it works

  1. A telephony provider, LiveKit room, or campaign attach request reaches a fleet worker.
  2. CXB Core reserves one call slot through CallTracker.
  3. CXB Core fetches bot configuration from CXB API.
  4. The pipeline runs: customer speech -> STT -> LLM/tools -> TTS -> audio response.
  5. On call end: recording uploads, auto-disposition/post-call analysis runs, and durable result delivery sends the call back to CXB API.

Transports

CXB Core supports four transport modes:
TransportProtocolAudioUse case
WebSocketWebSocket WSS8kHz LINEAR16WebSocket telephony dialler
LiveKit SIP InboundLiveKit SDK16kHzDID → LiveKit room → bot
LiveKit SIP OutboundLiveKit SDK16kHzCXB API-triggered outbound calls
ExotelExotel WebSocket8kHz LINEAR16Exotel Voicebot applet
Beyond the four transports, two more LiveKit entry points are first-class call routes on the same pipeline:
  • Campaign attach (POST /attach) — CXB Dialler creates and screens the LiveKit SIP call first, then asks CXB Core to join the already-answered room as the bot.
  • Web widget (POST /livekit/widget) — embeddable browser web-call entry point that joins a LiveKit room and runs the same pipeline.
All call routes share the same pipeline factory and post-call logic. The route-specific code owns only connection setup, metadata extraction, hangup/transfer primitives, and transport cleanup.

Agent Desk handoff

On the LiveKit routes (inbound, outbound, attach), instead of a SIP transfer the bot can escalate to a human agent: CXB Core enqueues a durable handoff to CXB API and starts a hold worker that keeps the caller engaged while an agent is located. A successful enqueue sets disconnected_by = "transfer_to_agent", and the hard route timeout deliberately does not tear down a call that has been handed off.

Tech stack

ComponentTechnology
RuntimePython 3.12, FastAPI, uvicorn
Pipeline frameworkthe media pipeline framework
STTstreaming STT, turn-detecting STT, multilingual STT
LLMthe LLM provider, the managed LLM platform
TTSthe text-to-speech (TTS) engine
VADvoice activity detection (VAD)
Turn detectionthe turn-detection model
Recording storageS3-compatible storage: DigitalOcean Spaces or MinIO
Package manageruv

Statelessness

CXB Core is architecturally stateless with respect to business data. It does not own bots, campaigns, users, call history, CRM mappings, or analytics. Those live in CXB API and MongoDB. The cross-call state inside a worker is operational:
  • CallTracker tracks active call IDs to enforce MAX_CONCURRENT_CALLS.
  • Result and Agent Desk outboxes persist delivery attempts so transient CXB API failures do not immediately lose post-call results or handoff requests.
  • Provider clients and caches may be reused inside the process for performance.
Workers can be independently restarted. A crash can drop the active call on that worker, but it should not corrupt durable platform state.