Skip to main content

How It Works

Decision Flow​

Every time a ticket message is created, the extension checks whether the AI should reply:

New ticket message created
│
▼
Was it sent by the bot user? → YES → Stop (anti-loop)
│ NO
▼
Was it sent by a staff member? → YES → Stop
│ NO
▼
Has any human staff already replied → YES → Stop (human hand-off)
to this ticket before?
│ NO
▼
Is the department in the allowed list? → NO → Stop
│ YES
▼
Call AI API with conversation history
│
├── API error / timeout → Discord notification (if set)
├── AI replies [[ESCALATE]] → Discord notification (if set)
└── AI returns an answer → Post reply as bot user

Human Hand-off​

Once any human staff member writes a reply in a ticket, the AI permanently stops responding to that ticket — even if the customer replies again afterwards.

This prevents situations where a staff member is handling a ticket but the AI keeps jumping in.


Escalation​

If the AI cannot answer a question, it is instructed to respond with the internal marker [[ESCALATE]]. The extension detects this and:

  1. Does not post any reply to the ticket
  2. Sends a Discord notification (if a webhook is configured)

The ticket stays open and marked for human follow-up.


Context Sent to the AI​

For every ticket, the extension sends:

  1. Your System Prompt + Hosting / Company Information as a system message
  2. The ticket subject so the AI knows the topic
  3. Up to the last 10 messages of the ticket conversation as context

Messages from the bot user are sent as assistant role; all other messages are sent as user role.


Ticket Status​

The extension does not change ticket status manually — Paymenter handles this automatically:

  • Customer sends message → ticket status becomes open
  • Bot (or any staff) replies → ticket status becomes replied
  • If AI escalates and no reply is sent → status stays open