SMS agents

Build AI agents that converse over text message — async, threaded, with the same brain as your voice and chat agents.

SMS agents handle two-way text conversations. They use the same LLM, the same knowledge bases, the same tools as your voice and chat agents — but respond via SMS instead of speech or web chat.

When you need one

  • High-intent inbound — when customers text the same number they call (e.g., "txt us for a quote").
  • Long-running threads — SMS doesn't have to resolve in 60 seconds; a customer can text back hours later and pick up where they left off.
  • Offline / low-friction channels — anyone with a phone can text. No app install, no signup.
  • Appointment confirmations and reminders — customers can reply "yes" or "no" instead of clicking a link.

Create an SMS agent

Dashboard → Agents → New agent → SMS.

Required fields:

  • Name — internal label.
  • System prompt — the personality and behavior. Same as voice/chat, except optimized for short text replies: avoid long monologues, ask one question at a time.
  • First message — sent automatically when a contact texts in for the first time. Can be a brief greeting + offer to help.
  • LLM provider + model — see Models. Chat and SMS use the same LLM lineup.

Optional but recommended:

  • Knowledge base — let the agent answer FAQ-style questions accurately.
  • CRM integration — write each conversation to your CRM as a thread.
  • Custom tools — webhook tools your agent can call mid-thread (e.g., "look up my order").

Session model

A session is a single text thread between a contact and your number:

  1. Contact sends their first text to your number.
  2. Nerva creates a new session and routes the message to your agent.
  3. Agent replies via SMS.
  4. The thread continues until one of:
    • 24 hours of inactivity — session is closed automatically. The next text from the same contact starts a fresh session.
    • Explicit close by the agent (e.g., "anything else? No? Great, have a good day!" followed by a tool call to end).

The 24-hour window matches how customers actually use SMS — they reply hours later, sometimes the next morning. A 30-minute timeout would close too many real conversations prematurely.

Phone numbers

SMS agents need an SMS-capable phone number:

  • Pick one with SMS capability when you provision it from Dashboard → Numbers.
  • Or import an existing Twilio/Plivo number that has SMS enabled.

In the US, SMS-capable long codes require A2P 10DLC registration — you'll provide your business name, brand, and use case to your provider (Twilio handles this in their console). Without registration, your SMS sends will be filtered by US carriers.

Toll-free numbers and short codes have different rules — check with your carrier.

Crafting the agent prompt for SMS

SMS has different rhythm than voice or chat. A few prompt notes:

  • Keep replies under 160 characters when possible. Longer texts get split into multiple segments and feel spammy.
  • One question at a time. "What's your name, email, and date of birth?" gets ignored. Ask sequentially.
  • No formatting. SMS doesn't render markdown, bullets, or bold. Plain text only.
  • Use emoji sparingly. Tasteful but not gratuitous.
  • Always offer "STOP". Customers expect to be able to opt out at any time. Train your agent to acknowledge "STOP" and "UNSUBSCRIBE" cleanly.

Example system prompt addition:

Keep every reply under 160 characters. Ask one question at a time. Never use markdown. If the contact says "STOP" or "UNSUBSCRIBE", reply once with "Understood — you won't hear from us again." and end the conversation.

Outbound SMS

Two ways to send the first message:

  1. Customer texts you first. The agent replies via the configured first-message and the conversation begins.
  2. You send the first message programmatically (e.g., from a webhook handler, your CRM, or your backend). Use the send_sms tool from within another agent, or call the SMS send API directly.

For volume outbound (e.g., reminder texts to 500 patients), use Campaigns configured for SMS — same UX, just text instead of voice.

Webhooks

Subscribe to real-time events:

  • sms.started — first inbound message of a new session
  • sms.ended — 24 hours after the last message
  • sms.analyzed — after post-processing completes
  • sms.failed — send/receive errors

See Webhook events.

Compliance

SMS is heavily regulated in many countries:

  • US / Canada (TCPA) — written consent required before texting. Honor STOP / opt-out instantly. A2P 10DLC registration required.
  • UK / EU (PECR / GDPR) — clear consent + ability to opt out + record of consent.
  • India (TRAI) — DLT registration, header IDs, template approval.
  • Other regions — check your local SMS regulator. Your messaging provider (Twilio/Plivo) will warn you on common pitfalls.

We provide the agent platform. Consent collection, opt-out handling, and regulatory registrations are your responsibility.

Tips for SMB owners

  • Reply speed matters. Set short LLM models (GPT-4o-mini, Claude Haiku) so replies arrive in 2–3 seconds, not 15.
  • Save the agent's voice/tone. Customers can tell when SMS feels robotic. A casual, conversational tone outperforms a corporate one.
  • Don't overshare data. Don't include order details, account numbers, or anything sensitive in an SMS — they're not encrypted at rest on most phones.
  • Watch deliverability. Carriers filter spammy patterns. If your agent suggests links, use short, branded URLs (not generic shortened ones) to avoid being marked as spam.

See also

On this page