DEV Community

jason rauch
jason rauch

Posted on

I Built an AI Customer Service Platform You Can Deploy in One Click

I Built an AI Customer Service Platform You Can Deploy in One Click 🤖

After spending weeks building customer service bots for different projects, I kept rebuilding the same infrastructure: database setup, Redis caching, AI integration, sentiment analysis, escalation logic...

So I packaged it all into a one-click deployable template.

What It Is

An open-source, production-ready AI customer service platform that handles:

  • 💬 Multi-channel support - Chat, email, and SMS (via Twilio)
  • 🧠 Claude AI integration - Intelligent, context-aware responses
  • 📊 Sentiment analysis - Detects frustrated customers automatically
  • 🚨 Smart escalation - Knows when to hand off to humans
  • 💾 Full conversation history - PostgreSQL database with analytics
  • âš¡ Redis caching - Fast response times at scale
  • 🔌 Real-time WebSockets - Live updates via Socket.io

Why I Built This

Most AI customer service solutions are either:

  1. Enterprise-only (expensive, complex)
  2. Code-heavy (requires weeks of setup)
  3. Closed-source (can't customize)

I wanted something that just works - deploy it, add your API key, and you're handling customer support with AI in minutes.

The Tech Stack

// Core dependencies
- Claude AI (Anthropic) - The brain
- PostgreSQL - Conversation storage
- Redis - Session caching
- Socket.io - Real-time connections
- Express.js - API server
- Node.js - Runtime
Enter fullscreen mode Exit fullscreen mode

Key Features I'm Proud Of

Intelligent Escalation

The bot doesn't just blindly respond. It analyzes:

  • Customer sentiment (positive/negative/neutral)
  • Message intent (question/complaint/request)
  • Conversation complexity

When it detects frustration or confusion, it automatically suggests human escalation.

Multi-Channel Support

Same conversation, different channels:

// Customer starts on chat
POST /api/conversations

// Switches to email
POST /api/conversations/:id/messages

// Bot maintains context across channels
Enter fullscreen mode Exit fullscreen mode

Built-in Knowledge Base

Feed it your docs, FAQs, product info - it'll reference them in responses:

const kbArticles = await aiService.searchKnowledgeBase(query);
const response = await aiService.generateResponse(
  conversation,
  messages,
  kbArticles
);
Enter fullscreen mode Exit fullscreen mode

One-Click Deploy

The entire thing deploys to Railway in literally 60 seconds:

Deploy on Railway

  1. Click the button
  2. Add your Anthropic API key
  3. Done. PostgreSQL and Redis auto-configure.

Live Demo

Check it out running live: ai-customer-service-agent-production.up.railway.app

The /health endpoint shows all services connected:

{
  "status": "healthy",
  "timestamp": "2026-04-23T00:34:08.719Z",
  "ai": true
}
Enter fullscreen mode Exit fullscreen mode

API Endpoints

Once deployed, you get:

GET  /health                          # Health check
POST /api/customers                   # Create/get customer
POST /api/conversations               # Start conversation
POST /api/conversations/:id/messages  # Send message
GET  /api/conversations               # List conversations
POST /api/conversations/:id/escalate  # Escalate to human
GET  /api/dashboard                   # Analytics
Enter fullscreen mode Exit fullscreen mode

How AI Responses Work

Here's the flow when a customer sends a message:

  1. Search knowledge base for relevant articles
  2. Analyze sentiment of customer message
  3. Extract intent (question/issue/request)
  4. Generate response using Claude with context
  5. Check escalation - does this need a human?
  6. Save everything to PostgreSQL
  7. Broadcast via WebSocket for real-time updates
const aiResponse = await aiService.generateResponse(
  conversation,
  messageHistory,
  knowledgeBaseArticles
);

if (aiResponse.needsEscalation) {
  await escalateToHuman(conversationId);
}
Enter fullscreen mode Exit fullscreen mode

What's Next

I'm working on:

  • [ ] Voice support (Twilio Voice API)
  • [ ] Multi-language detection
  • [ ] Custom AI training on conversation history
  • [ ] Slack integration
  • [ ] API rate limiting per customer

Try It Yourself

GitHub: github.com/Jeah84/ai-customer-service-agent

Deploy: railway.com/deploy/ddWbPN

Stack: Node.js, Claude AI, PostgreSQL, Redis, Socket.io


Built this because I needed it for my own projects. Figured others might too.

What features would you add? Drop a comment! 👇


Also submitted this as a Railway Template - hoping to help more developers ship AI-powered support faster.

Top comments (0)