DEV Community

Sonam
Sonam

Posted on

Build an SMS Triage Bot on Telnyx Edge Compute

Support SMS inboxes are usually a routing problem before they are an AI problem.

Someone asks about billing. Someone else needs technical support. A third person wants to talk to sales. The app has to understand the message, pick the right destination, reply to the customer, and remember what happened.

This TypeScript example does that on Telnyx Edge Compute with the Agent SDK.

Code: https://github.com/team-telnyx/telnyx-code-examples/tree/main/agent-sms-triage-bot

What it builds

agent-sms-triage-bot receives inbound SMS webhooks, classifies each message into one of four topics, looks up the route for that topic, replies by SMS, and stores triage history in durable actor state.

The topics are:

  • billing
  • support
  • sales
  • general

The default route table maps those topics to queue names:

billing -> billing-queue
support -> support-queue
sales   -> sales-queue
general -> general-queue