Skip to main content

AI Agent Impact & Dependencies — "1 CID Multiple WABA"

FieldValue
KindDependency / impact assessment (pre-RFC)
Source initiative[High Level PRD] 1 CID Multiple WABA — Lingga Mahesa (Platform/WhatsApp/Billing), QON/51170246951
Source statusDiscovery · target GA Sept 2026 (Meta Coex GA)
Grounded againstchatbot (BE) + chatbot-fe (FE), surveyed 2026-06-29

TL;DR

Multi-WABA moves Qontak from 1 company = 1 WABA to 1 company = N WABAs and scopes templates and broadcasts per waba_id (cross-WABA template sends rejected with 422 — Template not valid for this WABA).

The AI Agent is mostly insulated because routing, KB/RAG, actions, and agent identity key off channel_integration_id / organization_id, never waba_id. The source PRD's "Chatbot / Automation" edge cases are accurate. However, the PRD under-states three items that fall to the AI Agent owner and must be tracked as dependencies before Multi-WABA GA.

1. Confirmed STABLE (no change needed)

AreaWhy it survivesEvidence (chatbot repo)
AI Agent core identityScoped to organization_id; no WABA/channel columnapp/models/ai_agent.rb
Inbound routing → botRoom → channel_integration_id → Intent; WABA absent from pathapp/models/room.rb, app/core/use_cases/system/hub/process_incoming_message_with_resolve.rb
AI Agent actions / tool-callsTarget resolved from the room's channel integrationapp/core/repositories/node_executions/nodes/mekari_qontak_chat/execute.rb
Knowledge base / RAGOrg-scoped (one org = one KB even with N WABAs)lib/ai_service/ai_agent.rb
Outbound bot messagesAlways carry channel_integration_id; Hub maps channel → WABA downstreamlib/hub/chat_service/messages/create_message_by_bot.rb
In-session idle follow-upFree-text, not HSM (24h window) → unaffected by template scopingchatbot-fe/modules/ai-agent/components/forms/AiAgentIdleActionForm.vue

PRD edge cases re-validated against code: assignment by channel_integration_id survives WABA migration; Coex channels must be added to routing rules manually; a cross-WABA reply opens a new independent room. All correct.

2. Gaps the source PRD under-states

Gap 1 — Bot-initiated template/Flow sends are not WABA-aware (latent 422)

  • Finding: intent_whatsapp_flow stores template_id + template_name but no waba_id (app/models/intent_whatsapp_flow.rb, app/core/use_cases/system/hub/send_message_whatsapp_flow.rb).
  • Risk: PRD makes templates WABA-scoped + adds 422 enforcement on Direct Send & Broadcast APIs. WhatsApp templates are namespaced per WABA. If one org holds the same template name across two WABAs, send-by-name becomes ambiguous and bot template sends can fail.
  • Today's protection: 1 agent = 1 channel, so Hub resolves the correct WABA namespace. This protection disappears the moment an agent spans WABAs (see Gap 2).
  • Action: Confirm with engineering (RFC waba_accounts owner — Mochamad Rahmandanu) that Hub resolves the template namespace from the channel's WABA automatically for bot-sent templates. If not, add waba_id to intent_whatsapp_flow + validate template.waba_id == channel.waba_id before send.

Gap 2 — AI Agent ↔ channel binding is single-channel & auto-picks first channel

  • Finding: FE binds an agent to channels.data[0] — the first channel, no picker (chatbot-fe/modules/ai-agent/components/modals/AiAgentModal.vue, chatbot-fe/store/ai-agent/interface.ts).
  • Risk: For a multi-brand org (N WABAs, each with channels) "first channel" is arbitrary and brand-blind. Multi-WABA turns an existing fragility into a real defect.
  • Action / design decision: Can one AI agent span multiple WABAs, or is it one-agent-per-WABA? Same fork as the PRD's Open Question #1 (consolidated inbox vs. forced WABA selection). Must be resolved before Lingga's Phase 2 design.

Gap 3 — AI Agent telemetry has no WABA/brand dimension

  • Finding: PRD adds waba_id to Broadcast Report, Conversation Report, billing logs, and CSV exports. The AI activity-log datamart (ai_activity_logs) and the Unified Agent Scorecard are org-scoped with no WABA/brand dimension.
  • Risk: For the enterprise multi-brand clients this initiative unlocks, AI confidence / containment / CSAT cannot be sliced per brand, even though billing now can.
  • Action: Add waba_id (and fbbm_id) as a dimension to the activity-log datamart and scorecard, mirroring how billing now segments per WABA. Own-roadmap item, not a GA blocker.

3. Dependencies to register against the Multi-WABA initiative

#DependencyOwnerBlocksType
D1Hub resolves template namespace from channel WABA for bot sends (or BE adds waba_id to intent_whatsapp_flow + validation)Chatbot BE + Hub/PlatformBot template/Flow sends for multi-WABA orgsPre-GA blocker
D2Decide one-agent-multi-WABA vs. one-agent-per-WABA (ties to PRD Open Q1)AI Agent PM + Platform PMPhase 2 designDesign decision
D3Add waba_id/fbbm_id dimension to AI activity-log datamart + scorecardAI Agent PM + BIPer-brand AI reportingOwn roadmap (post-GA OK)

4. Call to action

  1. Comment on QON/51170246951 raising D1 (namespace) and D3 (reporting parity) so they're captured in Discovery.
  2. Get D2 added to the PRD's Open Questions list (link to Open Q1).
  3. Track D1–D3 in the AI Agent backlog; promote D1 to a full chatbot TECH-RFC if Hub does not auto-resolve namespace.

Grounding note: BE = /Users/mekari/work/chatbot, FE = /Users/mekari/work/chatbot-fe. No broadcast→chatbot trigger path exists in BE (confirmed by search). Idle follow-up confirmed free-text, not HSM.