Modules
Chat
13 min
detailed functionality & workflow specification 1\ introduction & vision the commandit chat system is an integrated communication platform designed to streamline interactions between end users (clients), technicians, internal teams, and ai agents it serves as a central, dynamic hub for communication and workflow automation within the commandit ecosystem core vision & goals provide efficient channels for support requests and communication enable contextual collaboration linked directly to tickets, devices, and organizations leverage ai agents for automated triage, task execution, workflow progression, and technician assistance (copilot) offer clear visibility into technician presence and availability support standard live chat queuing and routing for human agents ensure accountability through logging and transcript association integrate seamlessly with time tracking for accurate billing and effort analysis align with platform goals zero noise (actionable interactions), automation, accountability, ai augmentation, and technician simplicity (presenting ai prepared info) primary access methods technicians/internal users primarily via the commandit agent ; secondarily via the commandit web application end users/clients primarily via the commandit agent (if deployed); secondarily via the client portal 2\ core concepts & underlying schema the chat system's functionality is built upon a robust schema chatchannels conversation container, stores context ( related ticket id , related device id ), type, status, ai summary channelparticipants links users (human/ai) to chatchannels , tracks join time, last read message id chatmessages stores individual messages, sender, timestamp, content type, attachment links, edit/delete status includes 'systemevent' type users represents participants ( is ai flag) stores presence/activity state ( usersessions , last system activity timestamp , current status enum ), push tokens, links to contacts contacts stores client details, notification preferences ( allow email/sms notifications ), sms consent given attachments central repository for file metadata ticketupdates stores saved chat transcripts and ai generated notes ticketupdateattachments (m2m) links chat attachments to transcript ticketupdates aitools defines functions callable by ai agents (interfacing with backend apis) aiagentconfigs / spaiagentoverrides define ai agent behavior automations / scripts reusable workflows/scripts callable by ai via aitools usersessions logs historical login/logout events and per session activity pendingchatrequests holds incoming client chats waiting for human agent assignment teams / userteamassignments defines groups for routing human chat requests notifications / sentnotifications / notificationtemplates framework for asynchronous user alerts roles / rolepermissions defines permissions (including chat monitor ) timeentries stores time logs includes related chat channel id to link time directly to chat activity supporting data ai and application logic access related data ( tickets , devices , documents , quotes , etc ) as needed 3\ user roles & access interfaces client/end user via agent or portal widget initiates/responds permissions via portal roles technician/internal user via agent or web app handles queues, collaborates, uses copilot, initiates chats permissions via internal roles ai agent backend participant ( users is ai=true ) executes tasks via aitools /apis manager via agent or web app tech capabilities + monitoring based on roles / permissions 4\ presence & activity indicators (technician view) technician availability is visualized to aid dispatch and collaboration green (active) agent checking in + active session + recent system interaction likely responsive amber (idle) agent checking in + active session + no recent system activity (idle threshold exceeded) may be present but inactive; response might be delayed red (agent offline) agent check in timestamp ( devices last agent checkin ) is stale device likely off/asleep; user unreachable via agent grey (agent unknown) no primary work device linked or agent has never checked in cannot determine status (real time updates depend on application's websocket layer) 5\ starting a chat client initiating via agent/portal routes to ai triage or human queue ( pendingchatrequests targeting a team ) context passed technician initiating dm user, dm contact (may trigger email/sms invite workflow if recipient offline/no user), contextual ticket/device chat system/ai initiating automated workflows create channels, add participants, send initial messages 6\ live chat workflow (human focus & ai handoff) queuing/routing pendingchatrequests target teams dispatchers/agents see queue based on team membership availability checked ( usersessions , current status enum ) assignment via broadcast or round robin client waits acceptance agent accepts > pendingchatrequests updated > chatchannel created > participants added > automatic time tracking starts (see section 6 1) during the chat standard messaging, file sharing, @mentions (triggering notifications ), read receipts ui supports toggling between multiple concurrent chats agent actions invite others, leave, transfer between teams system messages log events manager monitoring/snooping requires chat monitor permission application logic allows viewing live chatmessages without appearing in channelparticipants monitors are invisible and cannot interact to participate, they must explicitly "join chat" ending the chat mark chatchannel inactive automatic time tracking stops optional trigger to save transcript 6 1 automatic time tracking integration to ensure technician effort spent in chat is captured accurately timer start application logic automatically starts a timer and creates a timeentries record when a technician becomes actively engaged accepts a chat from pendingchatrequests joins or is added to a chatchannel brings a specific chat ui element into focus (requires front end tracking) timeentries creation user id = tech's id start time utc = current time end time utc = null (timer running) related chat channel id = the active channel id ticket id = populated immediately if chatchannels related ticket id exists, otherwise null work type id = set to a configured default (e g , "chat support") is billable = set based on worktype default / agreement rules timer stop/pause application logic automatically stops the current running timer (sets end time utc , calculates duration seconds ) when the tech switches focus away from the current chat window/tab the tech becomes idle (based on users last system activity timestamp exceeding threshold) the chat channel is closed/ended the tech's session ends (logout/timeout update usersessions ) (note this may result in multiple time entries per extended chat conversation) deferred ticket linking if a ticket is created or linked to the chatchannel after time tracking has begun, application logic finds previous timeentries for that related chat channel id where ticket id is null and updates them with the correct ticket id 7\ ai augmented chat & workflows (expanded) ai led ticket triage ai agent performs analysis, enrichment (setting agreement, linking related items/cis, finding duplicates via aitools ), applies tickettemplates , generates tickettasks , suggests plans, sets classifications if clarification is needed, it initiates/uses the chat channel to interact with the requester handoff to human team if unable to proceed ai working ticket tasks executes automations via aitools / agentcommandqueue , updates status/user via chat, handles approvals copilot assistance (for humans in chat) techs use commands (e g , /summarize , /search kb , /draft reply , /generate script , /request time off ) > ai uses context + aitools > responds within chat or performs backend actions ai actions on other entities ai parses chat intent > uses aitools > updates quotes , approvals , creates documents , etc 8\ transcript & attachment handling application generates transcript from chatmessages transcript saved as ticketupdates (usually internal) attachments from chat linked to the transcript ticketupdates via ticketupdateattachments 9\ notifications (user experience) offline application triggers push/email/sms via notifications / sentnotifications based on presence ( usersessions ), preferences ( contacts ), and consent device side alerts (agent/web ui) configurable audio alerts (icq option!), visual badges/highlights/toasts for new queue items ( pendingchatrequests ), messages, and @mentions 10\ ui persistence chat interface designed in the front end to remain accessible during navigation within primary user interfaces (agent, web app, portal)