system_prompt that powers your voice calls. No separate setup, no special “SMS mode”. One agent, two channels.
SMS replies are automatic for every inbound text. There’s no opt-in window, no campaign linkage required. If a phone number is wired to an agent, that agent answers texts to that number.
What the agent sees on every reply
Before calling the agent, the engine builds a system prompt with four layers:Real-time context
Date, time, day of week, timezone, customer phone, channel — all auto-included.
The time is formatted in your agent’s timezone, not server time.
Caller history (if any)
If this phone number has called your agent before, the most recent call summary is injected automatically.
First-time customers get no history block — clean and short.
Your agent's system prompt
Used as-is, with any
{{variables}} substituted. Same content you wrote for voice.Per-number business profile (if set)
If the dialled number has a
custom_prompt on its phone_numbers row, it is added as a BUSINESS PROFILE section - the specific business identity for that number (name, address, hours), overriding any conflicting general details in the agent prompt. Numbers without one fall back to the agent prompt alone. See Phone numbers.Voice and SMS share memory
This is one of the most useful properties of Nixflex: a customer who called you yesterday can text you today, and the agent remembers them. The engine looks up the most recent voice call from the customer’s number and includes the call summaries plus usage instructions for the agent — the same way it does on inbound voice. Across channels, your AI feels continuous. Example exchange after a prior call:Customer texts: “Hey, did I book yet?” Agent replies: “Yes — table for 4 on Friday at 7pm. Want me to change the time?”The customer didn’t have to re-introduce themselves. The agent referenced the past call naturally, only because the customer asked something it could answer from history.
Variables work the same as voice
Everything in Variables applies to SMS replies. Use{{current_date}}, {{caller_phone}}, {{caller_history}}, etc. in your agent prompt — the engine substitutes them per message.
Promotions, campaigns, special events
If you’re running a promotion (SMS campaign, seasonal offer, anything time-bound), mention it in your agent’ssystem_prompt so the agent can handle replies intelligently.
Conversation history
The engine loads the last 10 SMS messages between this customer and this agent into the prompt as chat history. The agent has full conversational context, so replies feel continuous over time. If a customer has texted you 50 times over a year, only the most recent 10 are loaded. This keeps prompts small and predictable.Channel awareness
The prompt explicitly tells the agent:Channel: SMS. This means the AI knows to write for text:
- Shorter sentences than voice
- No emoji or special characters (carriers can mangle them)
- No “let me check that for you” pauses
- Plain text only
system_prompt — it’s added automatically by the engine.
What replies cost
| Cost | Source |
|---|---|
| Per-message Twilio fee | Charged directly to your Twilio account (BYO Twilio) |
| LLM token usage | Charged to your Nixflex usage, same rate as voice |
When replies don’t happen
The engine returns silently (no error to the customer) in these cases:| Reason | What happened |
|---|---|
| Phone number not linked to an agent | The dialled number isn’t in phone_numbers and has no legacy mapping |
| Agent has no Twilio credentials | The agent is configured but its twilio_account_sid / twilio_auth_token are missing |
| The agent returned an empty response | Rare — usually a transient API issue, no message is sent |
| Twilio rejected the send | Carrier issue, invalid number format, etc. Logged for review. |
Customer privacy
Caller history pulls only from calls made by the same phone number to your agent. It never crosses agents, never crosses developers, never crosses Nixflex tenants. The data lives in your Supabase tenancy. If a customer asks you to forget them, deleting their rows fromcalls and sms_messages removes them from future replies.
SMS replies are conversational only
SMS replies are a text conversation - the agent answers questions, gives information, and holds context across messages. They do not run booking tools. Unlike a voice call, the agent on SMS cannot check live availability, book, reschedule, cancel, or look up an appointment on a connected calendar. If a customer texts asking to book or change an appointment, have the agent guide them to call (or to your booking link) in yoursystem_prompt - for example: If a customer asks to book or change an appointment over text, ask them to call us on the number so we can confirm it properly. Booking actions are reliable on calls, where the agent confirms details live; keeping them off SMS avoids mis-bookings from a missed or ambiguous text.
See also
- Variables — what gets injected into every prompt
- SMS campaigns — bulk one-shot broadcasts
- Send SMS — sending standalone messages via API
- Post-call analysis — how
caller_historygets its data - Inbound calls — voice side of the same agent