Markdown stripping
Markdown stripping is the runtime step where markdown formatting (asterisks, headers, brackets) is removed before sending output to channels that don't render markdown. SMS and voice are typical destinations: bold asterisks appear literally in SMS; TTS would read them aloud.
Why it matters
LLMs default to producing markdown-formatted output. Headers, bold text, bullet lists, code blocks, all rendered as markdown syntax. For chat surfaces with markdown rendering (web chat, Slack, Discord), this is fine. For SMS and voice, it is broken.
A response like "Tomorrow at 2pm you have:" sent to SMS arrives as literal asterisks: "Tomorrow at 2pm you have:". The user sees garbage. On voice, the TTS reads the asterisks aloud ("asterisk asterisk Tomorrow asterisk asterisk"); the result is nonsense.
Markdown stripping sits between the model's output and the channel's input. It detects markdown syntax and removes or rewrites it for the destination:
- SMS: strip asterisks, brackets, link syntax; keep plain text.
- Voice: strip everything markdown; rewrite emphasis as natural sentence structure if possible.
- WhatsApp: WhatsApp uses single-asterisk bold syntax; rewrite double-asterisk markdown to single, strip headers.
- Telegram: native markdown; pass through with minimal changes.
Each channel has slightly different rules. The stripping step is small but operationally important; without it, every channel-specific quirk becomes a user-visible bug.
How Ajeris handles this
Ajeris's channel adapter pipeline strips and rewrites markdown per destination channel. SMS and voice get plain text. WhatsApp gets WhatsApp-format markdown. Telegram gets native markdown. The model's output is the same in all cases; the per-channel adapter handles the rewriting.
For voice specifically, the stripping is more aggressive: lists become "first... second... third..." sentence patterns; bold becomes vocal emphasis through SSML hints to the TTS engine.