π¬ Build Message Generation and Scheduling System
Overview
Create the engine that decides when, what, and how to message users β personalized, timely, meaningful.
Goals
- Right message at the right time
- Context-aware (recent check-ins, triggers, milestones)
- Personalized based on learned patterns
- Never generic or robotic
Message Types
| Type |
Trigger |
Example |
| Check-in |
Daily schedule |
"Hey, how's today going?" |
| Anticipatory |
Pattern prediction |
"Friday night coming up. Want to lock in your plan?" |
| Contextual |
Recent event |
"Rough day yesterday β you good?" |
| Milestone |
Streak achieved |
"30 days. That's not luck β that's you." |
| Supportive |
Slip reported |
"Slips happen. You're not starting over." |
| Tool suggestion |
High-risk moment |
"Want to try a breathing exercise?" |
Scheduling Logic
Schedule Message:
IF quiet hours β skip
IF user disabled Buddy β skip
IF recent message (< 4 hours) β skip
Determine optimal time:
- Learned check-in window
- User timezone
- No quiet hours
Generate message:
- Context from mem0
- User tone preference
- Current situation (triggers, milestones)
Send via push notification
Message Generation Pipeline
- Context Assembly β Gather from mem0 (patterns, history)
- Prompt Building β Create AI prompt with context
- Generation β Vercel AI SDK streaming response
- Personalization β Apply tone, insert user details
- Delivery β Push notification with deep link
- Tracking β Log delivery, open, response
Implementation Tasks
Acceptance Criteria
Message Examples by Tone
Warm:
"Hey! Saw you hit 7 days. That's a whole week of choosing you. How are you feeling?"
Direct:
"7 days. What's working?"
Encouraging:
"A whole week! You're building something real here. Keep going!"
Related
Part of Sobers v2
π¬ Build Message Generation and Scheduling System
Overview
Create the engine that decides when, what, and how to message users β personalized, timely, meaningful.
Goals
Message Types
Scheduling Logic
Message Generation Pipeline
Implementation Tasks
Acceptance Criteria
Message Examples by Tone
Warm:
Direct:
Encouraging:
Related
Part of Sobers v2