Ownership rules
The platform is five services. Each has a clean primary job, so most bugs become easier once you place them in the right service.| Problem | Start in |
|---|---|
| Call audio, STT/LLM/TTS, tool execution, transfer tool, voicemail, dead air, post-call packaging | CXB Core |
| Bot config, API auth, calls table, campaigns API, CRM fetch/push, fleet selection, recordings, API keys | CXB API |
| Form behavior, dashboard display, filters, campaign wizard, bot builder, agent console | CXB Console |
| Campaign pacing, SIP dial attempts, AMD screening, retry scheduling, attach-to-worker failures | CXB Dialler |
| Browser call widget, web token fetch, in-page call UI | web call widget |
CXB Core
Primary files:| File | Why it matters |
|---|---|
src/core/app.py | FastAPI app, lifespan, call tracker, result outbox, Agent Desk outbox. |
src/core/pipeline/factory.py | Main media pipeline assembly. Start here for call behavior. |
src/core/pipeline/live_prompt_cache.py | Live prompt cache registry: LLM-provider cached-content create/refresh, bounded LRU, version-based invalidation. |
src/core/pipeline/tool_runtime.py | Custom HTTP tool execution and telemetry. |
src/core/routes/ws.py | Telephony WebSocket inbound. |
src/core/routes/livekit.py | LiveKit SIP inbound. |
src/core/routes/dialout.py | LiveKit SIP outbound. |
src/core/routes/exotel.py | Exotel Voicebot applet WebSocket inbound. |
src/core/routes/_post_call.py | Shared post-call finalization, auto dispositions, analysis, QC, webhook dispatch. |
src/core/processors/post_call.py | LLM post-call analysis and QC. Caches the LLM client SDK instance; do not create one per call. |
src/core/models/config.py | Runtime config contract from CXB API to CXB Core. |
CXB API
Primary files:| File | Why it matters |
|---|---|
src/api/app.py | FastAPI app, Mongo/Redis startup, indexes, routes, trunk health loop. |
src/api/routes/config.py | Runtime config endpoint consumed by CXB Core. |
src/api/services/config_service.py | Builds bot runtime config and call skeletons. |
src/api/routes/results.py | Receives CXB Core call results. |
src/api/services/call_service.py | Stores calls and pushes CRM post-call payloads. |
src/api/routes/sip.py | CRM/admin dialout endpoint and CXB Core SIP lookup helpers. |
src/api/services/fleet_service.py | Current outbound fleet selection. |
src/api/routes/campaigns.py | Campaign CRUD, upload, lifecycle actions, attempt report. |
src/api/services/knowledge_* | KB upload, chunking, embedding, vector-database search. |
CXB Console
Primary files:| File | Why it matters |
|---|---|
src/App.tsx | Route map and role-based layouts. |
src/pages/BotCreate.tsx / src/pages/BotDetail.tsx | Bot builder and edit workflow. |
src/hooks/useBotForm.ts | Bot form state, defaults, serialization, validation. |
src/pages/CampaignCreate.tsx / src/pages/CampaignDetail.tsx | Campaign setup and monitoring. |
src/pages/Settings.tsx | System settings, API keys, fleet URLs, provider keys, MinIO, Agent Assist. |
src/components/bot/IntegrationTab.tsx | Bot-specific CRM integration guide. |
src/pages/KnowledgeBases.tsx | KB management. |
CXB Dialler
Primary files:| File | Why it matters |
|---|---|
src/dialler/main.py | Process entrypoint, health server, graceful shutdown. |
src/dialler/loop.py | Campaign scheduling loop and state machine. |
src/dialler/fleet.py | Polls CXB Core fleet capacity and reserves best worker. |
src/dialler/sip_dialler.py | Creates LiveKit rooms and dials SIP participants. |
src/dialler/attacher.py | Attaches answered LiveKit rooms to CXB Core workers. |
src/dialler/amd.py | Answering machine detection screening. |
src/dialler/pacing.py | Predictive pacing formula and abandon-rate brake. |
src/dialler/metrics.py | Per-campaign rolling-window answer_rate, AHT, and abandon_rate. |
src/dialler/rate_limiter.py | Per-carrier CPS token bucket (GCRA-style) keyed by carrier/trunk. |
src/dialler/trunks.py | OutboundTrunkResolver + TrunkResolution; CXB API trunk lookup and per-carrier CPS/burst/channels. |
src/dialler/circuit_breaker.py | Per-dependency async circuit breaker (closed/open/half-open) for fleet/SIP/API calls. |
src/dialler/health.py | Liveness (tick staleness → 503) and /metrics endpoints. |
web call widget
The fifth component is an embeddable browser call widget (React 19 + LiveKit client, built with Vite). It is mounted on a host page viawindow.CXBridge.init({ botId, apiKey, label }), fetches a LiveKit access token, and opens a WebRTC call into a LiveKit room. CXB Core handles the room as a bot call through the /livekit/widget route and the same pipeline/post-call path as other transports.
Primary files:
| File | Why it matters |
|---|---|
src/index.tsx | Global CXBridge.init entry; mounts the widget on a host page. |
src/Widget.tsx | Call state machine, LiveKit Room lifecycle, mic track, agent state. |
src/token.ts | Fetches the LiveKit access token used to join the room. |
src/CallCard.tsx / src/Controls.tsx / src/AuraVisualizer.tsx | Call UI, controls, and audio visualizer. |