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.
ProblemStart in
Call audio, STT/LLM/TTS, tool execution, transfer tool, voicemail, dead air, post-call packagingCXB Core
Bot config, API auth, calls table, campaigns API, CRM fetch/push, fleet selection, recordings, API keysCXB API
Form behavior, dashboard display, filters, campaign wizard, bot builder, agent consoleCXB Console
Campaign pacing, SIP dial attempts, AMD screening, retry scheduling, attach-to-worker failuresCXB Dialler
Browser call widget, web token fetch, in-page call UIweb call widget

CXB Core

Primary files:
FileWhy it matters
src/core/app.pyFastAPI app, lifespan, call tracker, result outbox, Agent Desk outbox.
src/core/pipeline/factory.pyMain media pipeline assembly. Start here for call behavior.
src/core/pipeline/live_prompt_cache.pyLive prompt cache registry: LLM-provider cached-content create/refresh, bounded LRU, version-based invalidation.
src/core/pipeline/tool_runtime.pyCustom HTTP tool execution and telemetry.
src/core/routes/ws.pyTelephony WebSocket inbound.
src/core/routes/livekit.pyLiveKit SIP inbound.
src/core/routes/dialout.pyLiveKit SIP outbound.
src/core/routes/exotel.pyExotel Voicebot applet WebSocket inbound.
src/core/routes/_post_call.pyShared post-call finalization, auto dispositions, analysis, QC, webhook dispatch.
src/core/processors/post_call.pyLLM post-call analysis and QC. Caches the LLM client SDK instance; do not create one per call.
src/core/models/config.pyRuntime config contract from CXB API to CXB Core.
CXB Core should not own durable customer/business state. It may write temporary outbox files and upload recordings, but CXB API remains the source of truth.

CXB API

Primary files:
FileWhy it matters
src/api/app.pyFastAPI app, Mongo/Redis startup, indexes, routes, trunk health loop.
src/api/routes/config.pyRuntime config endpoint consumed by CXB Core.
src/api/services/config_service.pyBuilds bot runtime config and call skeletons.
src/api/routes/results.pyReceives CXB Core call results.
src/api/services/call_service.pyStores calls and pushes CRM post-call payloads.
src/api/routes/sip.pyCRM/admin dialout endpoint and CXB Core SIP lookup helpers.
src/api/services/fleet_service.pyCurrent outbound fleet selection.
src/api/routes/campaigns.pyCampaign CRUD, upload, lifecycle actions, attempt report.
src/api/services/knowledge_*KB upload, chunking, embedding, vector-database search.
CXB API should not run live media pipelines. It should issue config, store state, coordinate actions, and expose APIs.

CXB Console

Primary files:
FileWhy it matters
src/App.tsxRoute map and role-based layouts.
src/pages/BotCreate.tsx / src/pages/BotDetail.tsxBot builder and edit workflow.
src/hooks/useBotForm.tsBot form state, defaults, serialization, validation.
src/pages/CampaignCreate.tsx / src/pages/CampaignDetail.tsxCampaign setup and monitoring.
src/pages/Settings.tsxSystem settings, API keys, fleet URLs, provider keys, MinIO, Agent Assist.
src/components/bot/IntegrationTab.tsxBot-specific CRM integration guide.
src/pages/KnowledgeBases.tsxKB management.
CXB Console should not hard-code client-specific logic. Client/brand differences belong in brand config and build-time assets.

CXB Dialler

Primary files:
FileWhy it matters
src/dialler/main.pyProcess entrypoint, health server, graceful shutdown.
src/dialler/loop.pyCampaign scheduling loop and state machine.
src/dialler/fleet.pyPolls CXB Core fleet capacity and reserves best worker.
src/dialler/sip_dialler.pyCreates LiveKit rooms and dials SIP participants.
src/dialler/attacher.pyAttaches answered LiveKit rooms to CXB Core workers.
src/dialler/amd.pyAnswering machine detection screening.
src/dialler/pacing.pyPredictive pacing formula and abandon-rate brake.
src/dialler/metrics.pyPer-campaign rolling-window answer_rate, AHT, and abandon_rate.
src/dialler/rate_limiter.pyPer-carrier CPS token bucket (GCRA-style) keyed by carrier/trunk.
src/dialler/trunks.pyOutboundTrunkResolver + TrunkResolution; CXB API trunk lookup and per-carrier CPS/burst/channels.
src/dialler/circuit_breaker.pyPer-dependency async circuit breaker (closed/open/half-open) for fleet/SIP/API calls.
src/dialler/health.pyLiveness (tick staleness → 503) and /metrics endpoints.
CXB Dialler is intentionally separate from CXB API so campaign dispatch can evolve independently from the API server.

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 via window.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:
FileWhy it matters
src/index.tsxGlobal CXBridge.init entry; mounts the widget on a host page.
src/Widget.tsxCall state machine, LiveKit Room lifecycle, mic track, agent state.
src/token.tsFetches the LiveKit access token used to join the room.
src/CallCard.tsx / src/Controls.tsx / src/AuraVisualizer.tsxCall UI, controls, and audio visualizer.
The widget owns no business state; it is a thin client that authenticates and joins a room. Bot config, auth, and results stay in CXB API/CXB Core.