ChatOps Protocol

Hybrid intelligence workflows: Facilitating the seamless handoff between Neural Agents and Human Operators.

Duty Roster (Assignments)

The platform uses an `instanceAssignment` table to map Org Members to specific instances and roles.

ROLE: AGENT

Read-only access to chats. Can view history but cannot intervene or toggle AI states.

ROLE: ESCALATION_HANDLER

Full write access. Receive notifications for escalations. Can trigger manual override messages.

ROLE: SCHEDULER_OPERATOR

Campaign management only. Can create/edit scheduled broadcasts but not view private chats.

Escalation Lifecycle

An escalation is a formal state object stored in the `escalations` table. It pauses the Auto-Responder for a specific Chat JID.

State: OPEN

AI detects intent failure or User requests human. - Tool `escalateToHuman` is called. - AI sends "Connecting you to an agent..." - Auto-Responder PAUSED.

State: QUEUED

Escalation is routed to all members with `escalation_handler` duty. - In-app notification bell rings. - (Optional) WhatsApp notification sent to Agent's phone.

State: RESOLVED

Human agent marks ticket as resolved. - Auto-Responder RESUMED. - AI regains control of the chat context.

Live Intervention

Operators can inject messages into any stream without triggering a full escalation event.

Warning: Context Drift

Manually sent messages are added to the message history. However, the AI might not "realize" it didn't write them. This can confuse the LLM if the human contradicts the AI's previous statement.

Best Practice: Only intervene manually if you intend to resolve the entire conversation thread.