Simpli Sentiment
Customer health and sentiment tracker with escalation risk detection.
Frustrated customers don't always say "I want to cancel" — but their language signals it. Sentiment runs in the background, tracking customer emotions across every interaction and flagging escalation risk before it's too late.
Simpli Sentiment analyses customer messages to track emotional trajectory, detect escalation risk, and alert teams before situations deteriorate. It uses keyword-based analysis by default (no LLM required), with an optional ML module for deeper analysis.
Configuration
| Variable | Default | Description |
|---|---|---|
APP_PORT | 8000 | Server port |
APP_LOG_LEVEL | info | Log level |
DATABASE_URL | — | Database connection string |
REDIS_URL | — | Redis connection URL |
For ML-based analysis (optional):
pip install "simpli-sentiment[ml]"Start the server
simpli-sentiment serveAPI endpoints
POST /analyze
Analyse the sentiment of a message.
Request:
{
"customer_id": "C-001",
"text": "I've been waiting 3 days and this is completely unacceptable. I want to speak to a manager.",
"channel": "email"
}The channel field accepts values from the Channel enum: email, chat, phone, social, or web.
Response:
{
"score": -0.72,
"label": "negative",
"escalation_risk": 0.65,
"triggers": ["unacceptable", "manager"]
}- score: -1.0 (very negative) to 1.0 (very positive)
- label:
positive(score>= 0.3),neutral, ornegative(score<= -0.3) - escalation_risk: 0.0 to 1.0 — alerts are created when
>= 0.5 - triggers: escalation keywords found (e.g. cancel, lawsuit, manager, refund)
GET /customers/{customer_id}/sentiment
Get a customer's sentiment timeline.
Query parameters:
| Param | Default | Description |
|---|---|---|
limit | 50 | Max results (1-500) |
offset | 0 | Pagination offset |
Response:
{
"customer_id": "C-001",
"current_score": -0.72,
"trend": "declining",
"timeline": [
{"timestamp": "2025-01-15T10:00:00Z", "score": 0.3, "label": "positive", "source": "chat"},
{"timestamp": "2025-01-16T14:00:00Z", "score": -0.5, "label": "negative", "source": "email"},
{"timestamp": "2025-01-17T09:00:00Z", "score": -0.72, "label": "negative", "source": "email"}
]
}GET /alerts
Get escalation risk alerts.
Query parameters:
| Param | Description |
|---|---|
severity | Filter by low, medium, or high |
customer_id | Filter by customer |
limit | Max results (default: 50) |
offset | Pagination offset |
Response:
[
{
"id": "alert-uuid",
"customer_id": "C-001",
"severity": "high",
"reason": "Escalation risk 0.65 — triggers: unacceptable, manager",
"created_at": "2025-01-17T09:00:00Z"
}
]GET /health
Health check.
Next steps
- The Ticket Lifecycle — See how Sentiment monitors conversations in real-time
- Quality Improvement Loop — Use Sentiment as an early warning in your quality cycle
- Integration Overview — Feed Sentiment data back into your helpdesk