AI-powered support ticket analysis that predicts churn before it happens.
A fully automated SaaS ($249/mo) that analyzes customer support tickets using Claude AI to identify frustrated customers, predict churn risk, and send automatic alerts - all without any manual work from your customers.
Support Intelligence is a B2B micro-SaaS that helps founders understand what's happening in their support queue without manually reading every ticket.
- Automated Ticket Ingestion - Fetches tickets from your support platform API daily
- AI Analysis - Claude analyzes sentiment, frustration, churn risk, and extracts feature requests
- Weekly Executive Reports - Get actionable insights: what's broken, who's at risk, what to build next
- REST API - Query your data, trigger jobs manually, build dashboards
- Zero Maintenance - Runs on autopilot via cron scheduler
Every Monday morning, you receive a report like this:
## Weekly Support Overview
Total tickets: 127
Average frustration level: 4.2/10
Average churn risk: 3.1/10
## ⚠️ Critical: 8 High Churn Risk Tickets
These customers need immediate attention.
## 🔥 What's Broken
- Login page not loading on Safari
- Payment processor timing out
- Dashboard shows wrong data after timezone change
## 📊 Top Issue Categories
- bug: 45 tickets
- feature_request: 32 tickets
- billing: 18 tickets
## 💡 Feature Requests
- Dark mode for dashboard
- CSV export for reports
- Slack integration
## ✅ Recommended Actions for Next Week
1. **Urgent:** Reach out to 8 at-risk customers personally
2. **Fix immediately:** Login page not loading on Safari
3. **Address:** bug (45 tickets)
4. **Consider:** Evaluate feasibility of "Dark mode for dashboard"
Cron Scheduler
│
├─> Daily (2 AM): Ingest tickets → Analyze with Claude
└─> Weekly (Mon 3 AM): Generate executive report
│
↓
PostgreSQL Database
↑
REST API (Port 3000)
- Ingestion Service: Fetches tickets from external API, deduplicates, stores in PostgreSQL
- Analysis Service: Sends tickets to Claude in batches, extracts structured insights
- Report Generator: Aggregates weekly insights into executive summary
- REST API: CRUD operations, manual triggers, dashboard data
- Scheduler: Automates the pipeline (daily ingestion/analysis, weekly reports)
- Runtime: Node.js + TypeScript
- Database: PostgreSQL
- AI: Claude 3.5 Sonnet (Anthropic API)
- Scheduler: node-cron
- API: Express
- Node.js 18+ and npm
- PostgreSQL 14+
- Anthropic API key (get one here)
- Support ticket API access (e.g., Zendesk, Intercom, Help Scout)
npm installcp .env.example .envEdit .env:
DATABASE_URL=postgresql://user:password@localhost:5432/support_intelligence
ANTHROPIC_API_KEY=sk-ant-xxx
SUPPORT_API_URL=https://your-support-api.com/tickets
SUPPORT_API_KEY=your_api_key
PORT=3000
NODE_ENV=production
ENABLE_SCHEDULER=truecreatedb support_intelligencenpm run build
npm run migratepsql support_intelligenceINSERT INTO organizations (name, external_api_key, external_api_url)
VALUES ('Your Company', 'your_api_key', 'https://api.example.com/tickets')
RETURNING id;Save this organization ID - you'll need it.
npm run build
node dist/services/ingestion.js <your_org_id>node dist/services/analysis.js <your_org_id>node dist/services/report-generator.js <your_org_id>Option A: Scheduler Only
npm startThis runs the automated scheduler (daily ingestion/analysis at 2 AM, weekly reports on Monday at 3 AM).
Option B: API Server + Scheduler
Terminal 1:
npm run apiTerminal 2:
npm startGET /api/organizations- List all organizationsPOST /api/organizations- Create new organizationGET /api/organizations/:id- Get organization detailsGET /api/organizations/:id/dashboard- Get dashboard metrics
GET /api/organizations/:id/tickets- Get tickets (paginated)GET /api/organizations/:id/churn-risk- Get high churn risk tickets
GET /api/organizations/:id/reports- Get weekly reportsGET /api/reports/:reportId- Get specific report
POST /api/organizations/:id/ingest- Trigger ingestionPOST /api/organizations/:id/analyze- Trigger analysisPOST /api/organizations/:id/generate-report- Generate report now
curl http://localhost:3000/api/organizations/<org_id>/churn-risk1. Provision a server (DigitalOcean, Linode, Hetzner)
- Ubuntu 22.04 LTS
- 2 GB RAM minimum
- Install PostgreSQL
2. Set up the app
# SSH into server
ssh root@your-server-ip
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs postgresql
# Clone/upload your code
cd /opt
# (upload code via scp, git clone, etc.)
cd support-intelligence
# Install dependencies
npm install
# Set up .env
cp .env.example .env
nano .env # Add your credentials
# Run migrations
npm run build
npm run migrate
# Test it
npm run ingest <org_id>
npm run analyze <org_id>3. Set up systemd service
Create /etc/systemd/system/support-intelligence.service:
[Unit]
Description=Support Intelligence
After=network.target postgresql.service
[Service]
Type=simple
User=root
WorkingDirectory=/opt/support-intelligence
ExecStart=/usr/bin/npm start
Restart=on-failure
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.targetsystemctl daemon-reload
systemctl enable support-intelligence
systemctl start support-intelligence
systemctl status support-intelligence4. Optional: Set up API service
Create /etc/systemd/system/support-intelligence-api.service (same as above, but ExecStart=/usr/bin/npm run api).
# Build image
docker build -t support-intelligence .
# Run container
docker run -d \
--name support-intelligence \
-p 3000:3000 \
-e DATABASE_URL="postgresql://..." \
-e ANTHROPIC_API_KEY="..." \
-e ENABLE_SCHEDULER=true \
support-intelligence- Railway: Connect GitHub repo, set env vars, deploy
- Fly.io:
fly launch, configure database, deploy - Heroku:
heroku create, add Postgres addon, push
Edit src/scheduler/index.ts:
// Daily job at 2 AM
cron.schedule('0 2 * * *', async () => { ... });
// Weekly job Monday 3 AM
cron.schedule('0 3 * * 1', async () => { ... });Cron format: minute hour day month weekday
Edit src/services/analysis.ts:
BATCH_SIZE- Tickets per API call (default: 10)RATE_LIMIT_DELAY- ms between calls (default: 1000)- Claude model - Change
claude-3-5-sonnet-20241022toclaude-3-opus-20240229for deeper analysis
Edit src/services/report-generator.ts:
// Default threshold: 7/10
WHERE ta.churn_risk >= 7The ingestion service works with any REST API. Edit src/services/ingestion.ts:
async function fetchTicketsFromAPI(apiUrl: string, apiKey: string, since?: Date) {
const url = `https://yourcompany.zendesk.com/api/v2/tickets.json`;
const response = await fetch(url, {
headers: {
'Authorization': `Basic ${Buffer.from(apiKey).toString('base64')}`,
},
});
const data = await response.json();
return data.tickets;
}async function fetchTicketsFromAPI(apiUrl: string, apiKey: string, since?: Date) {
const url = `https://api.intercom.io/conversations`;
const response = await fetch(url, {
headers: {
'Authorization': `Bearer ${apiKey}`,
'Intercom-Version': '2.10',
},
});
const data = await response.json();
return data.conversations;
}Adjust the normalizeTicket() function to map your API's field names.
# Backup
pg_dump support_intelligence > backup.sql
# Restore
psql support_intelligence < backup.sql# Systemd
journalctl -u support-intelligence -f
# Docker
docker logs -f support-intelligence-- Tickets ingested today
SELECT COUNT(*) FROM support_tickets
WHERE DATE(created_at) = CURRENT_DATE;
-- Unanalyzed tickets
SELECT COUNT(*) FROM support_tickets st
LEFT JOIN ticket_analysis ta ON st.id = ta.ticket_id
WHERE ta.id IS NULL;
-- High churn risk customers
SELECT customer_id, COUNT(*) as tickets
FROM support_tickets st
JOIN ticket_analysis ta ON st.id = ta.ticket_id
WHERE ta.churn_risk >= 7
GROUP BY customer_id
ORDER BY tickets DESC;- Claude API: ~$5-30 (depends on ticket volume)
- 10k tickets/month ≈ $15
- First 1000 tickets = ~$1.50
- Server: $6-20 (DigitalOcean, Linode)
- Database: $0 (PostgreSQL included) or $7 (managed)
Total: $11-50/month per organization
- Starter: $49/month (1 organization, 1k tickets/month)
- Growth: $149/month (5k tickets/month)
- Scale: $299/month (20k tickets/month)
Profit margin: 50-80% after API costs.
- Fully automated - Set it and forget it
- Actionable insights - Not just data, tells you what to do
- Saves time - Founders don't read 100+ tickets/week
- Reduces churn - Identifies at-risk customers early
- Simple setup - 30 minutes to deploy
- SaaS founders with 50+ support tickets/week
- B2B companies with high-touch support
- Subscription businesses focused on retention
- Agencies managing multiple clients
- "Stop reading every support ticket"
- "Know which customers are about to churn"
- "Your weekly war room report, automated"
- Check
external_api_urlandexternal_api_keyin database - Test API manually:
curl -H "Authorization: Bearer YOUR_KEY" YOUR_API_URL - Check logs for API errors
- Verify
ANTHROPIC_API_KEYis set - Check Claude API quota: https://console.anthropic.com/
- Ensure unanalyzed tickets exist:
SELECT COUNT(*) FROM support_tickets st LEFT JOIN ticket_analysis ta ON st.id = ta.ticket_id WHERE ta.id IS NULL
- Reports cover the previous week (Monday-Sunday)
- Run
npm run report <org_id>manually to test - Check if tickets exist in that date range
Congrats on acquiring Support Intelligence! Here's what you need to know:
- Change credentials - Update
.envwith your Anthropic API key - Review database -
psql support_intelligenceand explore tables - Test the pipeline - Run ingestion, analysis, report manually
- Check cron jobs - Verify scheduler is running
- Set up monitoring - Use Uptime Robot or Pingdom for health checks
- Configure backups - Automate PostgreSQL backups (daily)
- Review costs - Check Anthropic API usage in console
- Onboard first customer - Add their organization, test full flow
- Customize prompts - Tune Claude analysis in
src/services/analysis.ts - Build simple dashboard - React/Next.js frontend for reports (optional)
- Add integrations - Zendesk, Intercom, Help Scout connectors
- Improve reports - Add charts, PDF export, email delivery
- Multi-tenancy: Already built - each organization is isolated
- White-label: Rebrand, custom domains per customer
- Integrations: Connect to Slack, email, webhooks
- Self-serve: Build signup flow, billing (Stripe), onboarding
MIT - Do whatever you want with this code.
This product is sold as-is. For questions about the code, read through:
src/services/- Core business logicsrc/api/server.ts- API endpointssrc/scheduler/index.ts- Automationmigrations/001_initial_schema.sql- Database schema
Good luck building your SaaS empire! 🚀