When a customer texts your business number, the engine routes the message to your agent and the agent replies — using the sameDocumentation Index
Fetch the complete documentation index at: https://docs.nixflex.com/llms.txt
Use this file to discover all available pages before exploring further.
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 Claude, 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 past 2 call summaries are 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.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 last 2 voice calls from the customer’s number and includes the call summaries plus usage instructions for Claude — 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. Claude 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 Claude: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) |
| Claude 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 |
| Claude 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.
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