← back to B Version 1
README.md
354 lines
# 🥯 Dear Bubbe - AI-Powered Yiddish Grandma Advice
**A complete SMS-based advice column system featuring Bubbe, your sarcastic, loving Jewish grandmother powered by Claude AI.**
## Overview
Dear Bubbe is a production-ready system that:
- Generates authentic Yiddish-grandmother-style advice using Claude AI (Anthropic)
- Delivers daily wisdom via SMS using Twilio
- Manages 1,000+ entries across 20+ categories
- Supports subscriber management and preferences
- Tracks delivery analytics
## Features
### 🎯 User Onboarding Flow (Web Interface)
**New 5-Step Interactive Onboarding:**
1. **Breaking News Display (Top of Page)**
- Shows 3 breaking news headlines at the top of the chat interface
- Auto-refreshes from live news feeds (BBC, CNN, Reuters, NYT, etc.)
- Provides instant context before user starts chatting
2. **Step 1: Local Information Permission**
> "Welcome, bubbeleh! Before we get started, would you like local news and weather? May I use your location to give you the best info? (I promise I'm not tracking you!)"
- User can say "yes" or "no"
- If yes: Enables IP-based location detection for local news/weather
- If no: Still works great, just without location-specific content
3. **Step 2: Content Preferences**
> "Perfect! What would you like today? I can help with weather, news, sports, advice, or answer any question you have!"
- User selects from: weather, news, sports, advice, or custom question
- Preferences stored for the session
- Can always change later by asking for different content
4. **Step 3: Yiddish Translation Toggle**
> "One more thing, mamaleh! Would you like to learn some Yiddish? I can show you translations in parentheses so you can pick up the language!"
- If yes: Enables Yiddish word translations like "meshugana (crazy)" in responses
- If no: Keeps responses clean without translations
- Helps users learn Yiddish naturally through conversation
5. **Step 4: Command Help**
- Type `:list` to see all available commands
- Shows personality modes, special features, and shortcuts
- Always accessible during conversation
**Available Commands:**
- `:list` - Show all available commands
- `/bubbe` - Switch to Bubbe Mode (sarcastic grandma)
- `/meshugana` - Switch to Meshugana Mode (crazy grandpa)
- `/comedian` - Switch to Comedian Mode (stand-up comedy)
- `:yiddish on` - Enable Yiddish translations
- `:yiddish off` - Disable Yiddish translations
### 🧠 AI Generation Pipeline
- **Claude-powered**: Uses Anthropic's Claude Sonnet 4.5 for authentic voice
- **Multiple personality modes**:
- **Bubbe Mode** 🥯: SARCASTIC Jewish grandma - biting wit with Yiddish, brutal food metaphors, and guilt-trip wisdom. She loves you but won't sugarcoat it!
- **Meshugana Mode** 🤪: Crazy old grandpa who thinks YOU'RE meshuga (crazy), not him! "What are you, meshuga?!" Calls you nuts while giving advice.
- **Comedian Mode** 🎤: Stand-up comedy style with observational humor
- **20+ categories**: Family, romance, work, money, holidays, and more
- **SMS-optimized**: Automatically generates short, punchy responses under 320 characters
- **Transform mode**: Convert existing advice columns into Bubbe's voice
### 📱 SMS Delivery System
- **Twilio integration**: Professional SMS delivery
- **Cron scheduling**: Daily automated sends at subscriber's preferred time
- **Smart selection**: Avoids repeats, ensures variety
- **STOP/START handling**: Automatic subscription management
- **Delivery tracking**: Full logs and analytics
### 🗄️ Database
- **PostgreSQL schema**: Production-ready with indexes
- **Subscriber management**: Preferences, timezones, frequency
- **Entry tracking**: Sent counts, eligibility dates, categories
- **Analytics views**: Built-in stats and reporting
## Project Structure
```
dear-bubbe/
├── database/
│ └── schema.sql # PostgreSQL schema
├── generator/
│ └── bubbe-generator.ts # AI generation pipeline
├── sms-scheduler/
│ └── sms-scheduler.ts # Twilio SMS delivery
├── api/
│ └── server.ts # REST API (coming soon)
├── web-interface/
│ └── admin-panel.html # Management UI (coming soon)
├── package.json
└── README.md
```
## Quick Start
### 1. Install Dependencies
```bash
cd /root/Projects/dear-bubbe
npm install
```
### 2. Set Environment Variables
Create `.env`:
```bash
# Anthropic (Claude AI)
ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
# Twilio
TWILIO_ACCOUNT_SID=ACxxxxx
TWILIO_AUTH_TOKEN=your-token
TWILIO_PHONE_NUMBER=+15551234567
# Database
DATABASE_URL=postgresql://localhost/dear_bubbe
```
### 3. Setup Database
```bash
# Create database
createdb dear_bubbe
# Run schema
npm run setup-db
```
### 4. Generate Your First Entries
```bash
# Generate 50 Bubbe entries
npm run generate 50
# This creates: bubbe-entries.json
```
### 5. Import to Database
```sql
-- Example: Import JSON entries
-- (Import script coming soon)
```
### 6. Start SMS Scheduler
```bash
# Test: Send immediately to all active subscribers
npm run send-sms
# Production: Start cron scheduler (daily at 8am)
npm run start-scheduler
```
## Usage Examples
### Generate AI Entries
```typescript
import { generateBatch } from './generator/bubbe-generator';
// Generate 100 random entries
const entries = await generateBatch(100);
// Generate specific categories
const familyEntries = await generateBatch(50, ['family', 'mother-in-law']);
```
### Transform Existing Questions
```typescript
import { transformExistingQuestion } from './generator/bubbe-generator';
const original = "My boyfriend never texts me back. What should I do?";
const bubbeVersion = await transformExistingQuestion(original, 'Ann Landers');
console.log(bubbeVersion.bubbeAnswer);
// Output: "Bubbeleh, he ghosts you? Move on! You're not a shmendrik waiting by the phone."
```
### Manual SMS Send
```typescript
import { processDailySends } from './sms-scheduler/sms-scheduler';
// Send to all active subscribers
await processDailySends();
```
## Database Schema
### Tables
1. **dear_bubbe_entries** - Advice column entries
- Original source tracking
- Bubbe transformations
- Category & tags
- SMS compatibility
- Send tracking
2. **sms_delivery_log** - Delivery history
- Twilio SIDs
- Delivery status
- Cost tracking
3. **subscribers** - User management
- Phone numbers
- Preferences
- Timezone & delivery time
- Subscription status
4. **feedback** - User ratings
- 1-5 star ratings
- Text feedback
## Categories
20 categories covering all advice topics:
- **Relationships**: family, romance, dating, marriage, friendship
- **Work & Money**: work, money, neighbors
- **Life Events**: holidays, grief, kids, teens
- **Situations**: mother-in-law, cheating, moral-dilemma, awkward
- **Misc**: health, etiquette, pets, misc
## Bubbe's Personality
### Voice Characteristics - SARCASTIC GRANDMA!
- **SARCASTIC with sharp wit**: "My brisket gets more attention than you" - brutal honesty wrapped in Yiddish
- **Biting but loving**: She'll roast you while giving advice - "What, you think you're a maven now?"
- **Yiddish integration**: meshuggeneh, oy vey, bubbeleh, kvetch, schmendrick, nudnik
- **Brutal food metaphors**: "Fresh challah, not day-old bread" - comparing your love life to food freshness
- **Guilt-trip wisdom**: "In my day we called first!" - weaponized nostalgia
- **No sugarcoating**: Direct, honest, sometimes harsh - but always helpful
- **Practical advice**: Actionable steps delivered with maximum sass
- **ALWAYS ends with follow-up question**: After making a comment, always ask a question to keep you thinking - "You think that's normal? What's wrong with a phone call?"
### Yiddish Levels
- **Light**: 1-2 Yiddish words per response
- **Medium**: 3-5 words (default)
- **Heavy**: 6+ words, more traditional phrasing
### Sample Entries
#### Romance
**Q**: "My boyfriend texts once a day. Is he busy or losing interest?"
**Bubbe**: "Sweetheart, my brisket gets more attention in the oven. He's losing interest. Find someone who treats you like fresh challah, not day-old bread."
#### Mother-in-Law
**Q**: "My mother-in-law shows up unannounced every weekend."
**Bubbe**: "Oy vey! Tell that meshuggeneh: 'I love you, but call first.' Set boundaries or she'll be moving in with her knitting."
#### Work
**Q**: "My boss takes credit for my work. What should I do?"
**Bubbe**: "Document everything, bubbeleh. Schedule a meeting. Be firm, not a shmendrik. You deserve respect AND that raise."
## Legal & Ethical
### Copyright Compliance
✅ **LEGAL**:
- AI-generated original entries (Bubbe Original)
- Public domain sources (pre-1964)
- Transformative use (summarized, rewritten)
- Licensed archive access (if you subscribe)
❌ **NOT LEGAL**:
- Direct republishing of copyrighted columns
- Scraping without permission
- Redistributing raw text
### This System is Legal Because:
1. **Transformative work**: Original questions → Bubbe's voice
2. **New creative work**: AI-generated entries
3. **Different purpose**: SMS daily wisdom vs. newspaper columns
4. **Added value**: Yiddish grandmother character, SMS format
## Scaling
### Current Capacity
- **Database**: 1,000+ entries
- **Daily sends**: Unlimited (Twilio rate limits apply)
- **AI generation**: ~50 entries/hour (Claude rate limits)
### Growth Path
1. **Phase 1** (Current): 100-500 entries, 10-100 subscribers
2. **Phase 2**: 500-1,000 entries, 100-1,000 subscribers
3. **Phase 3**: 1,000+ entries, 1,000+ subscribers
- Add category preferences
- A/B test different voices
- Premium features (morning + evening)
## Costs
### Claude AI (Anthropic)
- Sonnet 4.5: ~$3 per million input tokens
- **Estimate**: $5-10/month for 500 generations
### Twilio SMS
- $0.0079 per SMS (US)
- **Estimate**:
- 100 subscribers = $23.70/month
- 1,000 subscribers = $237/month
### Database (PostgreSQL)
- Self-hosted: Free
- Managed (Heroku, Render): $5-25/month
## Roadmap
- [ ] REST API for subscriber management
- [ ] Web admin panel
- [ ] Category preferences per subscriber
- [ ] User feedback/ratings
- [ ] WhatsApp integration
- [ ] Multi-language support (keep Yiddish!)
- [ ] Premium tier (2x per day)
- [ ] Bubbe voice calls (Twilio Voice)
## Contributing
This is a complete, production-ready system. Feel free to:
- Add more categories
- Adjust Bubbe's personality
- Create themed collections (holiday specials, wedding season, etc.)
- Build additional interfaces
## License
MIT License - Use commercially, modify freely
## Credits
- **AI**: Claude Sonnet 4.5 by Anthropic
- **SMS**: Twilio
- **Inspiration**: Dear Abby, Ann Landers, your actual Bubbe
---
**Oy vey, you're going to love this meshuggeneh project! 🥯💙**