Platform overview

CX Bridge is split into five working services. The important architectural boundary is that CXB Core runs calls, while CXB API owns durable business state.
ServicePlaneOwns
CXB CoreRuntime/media planeLive call workers, transport adapters, media pipeline, recording upload, post-call packaging, result delivery, Agent Desk handoff hooks
CXB APIControl planeAuth, bots, campaigns, system settings, runtime config, call records, CRM integrations, API keys, recordings, fleet selection
CXB ConsoleOperator surfaceBot builder, campaign builder, call logs, analytics, settings, Agent Desk, knowledge bases
CXB DiallerCampaign execution planeCampaign leases, pacing, retry scheduling, LiveKit SIP dialing, AMD screening, answered-call attach
web call widgetEmbeddable web surfaceBrowser call widget (React + LiveKit client) that joins a LiveKit room handled by CXB Core via /livekit/widget

CXB Core runtime architecture

CXB Core is a FastAPI app running multiple single-process uvicorn workers behind nginx. Each production worker is one call slot. Production settings:
SettingCurrent production intent
MAX_CONCURRENT_CALLS1 per worker
CXBCORE_WORKERSActual worker count reported in health, commonly 16 on 8 GB / 4 CPU hosts
nginx max_conns=1Prevents a busy worker socket from receiving another call
uvicorn --workersAlways 1; systemd instance count is the worker count
This model is intentionally simple: one stuck/crashed worker can drop one call, not a batch of calls.

Call entry points

Entry pointRouteUsed byNotes
Telephony WebSocketwss://fleet.example.com/ws/{bot_id}WebSocket dialler8 kHz LINEAR16
Exotel Voicebotwss://fleet.example.com/exotel/{bot_id}Exotel App Bazaar8 kHz LINEAR16, built-in serializer
LiveKit SIP inboundPOST /livekit/dispatchLiveKit SIP webhookDID -> LiveKit room -> bot
LiveKit SIP outboundPOST /livekit/dialoutCXB API direct dialoutCXB Core creates room and dials SIP participant
Campaign attachPOST /attachCXB DiallerDialler creates/screens SIP call, then CXB Core joins answered room
Widget callPOST /livekit/widgetCXB Console/web widgetUses LiveKit room path
All call paths converge on the pipeline builder in the Core service and the shared post-call finalization step.

Pipeline

Current provider families:
LayerProviders
STTStreaming STT, turn-detecting STT, multilingual STT
LLMA language model via the LLM provider, or a managed LLM platform
TTSMultiple interchangeable text-to-speech (TTS) engines
VAD / turnsVoice activity detection (VAD), the turn-detection model, or STT-native external turn detection
Built-in tools include end_call, transfer_call, detected_voicemail, and search_knowledge. The search_knowledge tool queries the bot’s Knowledge Base, which CXB API backs with vector-database search over uploaded, chunked, and embedded documents. Custom HTTP tools run through the tool runtime and emit telemetry events. When live prompt caching is active, CXB Core serves the static policy/system prompt from a cached-content entry on the LLM provider (or via the LLM provider’s prompt-cache-key hints). In that mode the pipeline builder passes tools=NOT_GIVEN and folds tools and the system instruction into the cached content, because the LLM provider rejects per-request tools combined with cached content.

Outbound and campaign flows

Direct outbound calls and campaign calls are intentionally different: CXB API currently distributes direct outbound calls by polling configured fleet URLs and choosing the server with the most available capacity. CXB Dialler performs campaign pacing and attach orchestration separately.

State boundaries

CXB Core should be treated as mostly stateless call execution:
  • It does not store bots, users, campaigns, analytics, or CRM config.
  • It fetches runtime config at call start.
  • It uploads recordings to configured S3-compatible storage.
  • It sends final results to CXB API through a durable result outbox.
  • It persists Agent Desk handoff enqueue attempts through a separate outbox.
CXB API is the source of truth for product state. MongoDB contains durable records; Redis is used for runtime/cache concerns; the vector database stores knowledge-base vectors.

Failure model

FailureExpected behavior
One CXB Core worker crashesActive call on that worker is lost; other workers continue.
CXB API temporarily unavailable during result deliveryResult remains in CXB Core outbox and is retried.
Agent Desk enqueue temporarily failsHandoff remains in Agent Desk outbox and is retried.
Fleet host fullnginx/app capacity returns busy; CXB API/CXB Dialler should pick another host or retry later.
Per-host MinIO used for recordingsPlayback depends on finding the originating host; shared object storage is preferred.

Scaling direction

The current production architecture is good for controlled fleet growth, but 1K-channel scale needs more than “more workers”:
  • worker/container registration with TTL
  • atomic capacity reservation
  • partitioned CXB Dialler workers or campaign leases
  • shared object storage everywhere
  • stronger metrics, tracing, and per-provider cost visibility
  • scripted or orchestrated host/container provisioning
See Fleet capacity and Docker roadmap for the scale plan.