Back to all days

Day 24 — ML Engineering

Sentiment Analysis Pipeline

1,000 reviews. One question: “Are our customers happy?”

An ML-powered MCP server that processes customer reviews, scores sentiment, extracts recurring themes, and surfaces what people actually care about. Not star ratings — real patterns, real trends, real action items.

Example Queries

“Are our customers happy at the Grand Oak Hotel?”
“What are people complaining about most at Saffron Kitchen?”
“Show me the sentiment trend for Coastal Brew over the last 6 weeks”
“Which business has the best reviews right now?”
“What should Pulse Fitness fix first?”
“Find all 1-star reviews that mention wait times”

Tools

6 MCP Tools

ToolWhat It Does
review_searchSearch reviews by business, source, rating, sentiment, date range, or keyword. Returns review text with sentiment scores.
sentiment_overviewSentiment breakdown for a business — overall score, positive/neutral/negative split, average rating, and top themes driving sentiment.
theme_analysisAnalyze what customers talk about most — themes, categories, average sentiment per theme, trend direction, and sample reviews.
trend_trackerTrack sentiment over time — weekly scores, review volume, positive/negative split, and which themes are rising or falling.
competitive_sentimentCompare sentiment across all tracked businesses — side-by-side scores, strengths, weaknesses, and rankings.
action_itemsPrioritized action items based on negative themes, declining trends, and recurring complaints — with supporting review evidence.

The Pipeline

How Sentiment Analysis Works

Every review is processed through a multi-layer pipeline that goes beyond simple positive/negative classification:

Score

Each review gets a sentiment score from -1.0 (strongly negative) to +1.0 (strongly positive), with labels: positive, neutral, negative.

Extract

Key themes are identified from review text — staff service, food quality, cleanliness, pricing, facilities — and mapped to categories.

Aggregate

Weekly snapshots track sentiment over time, showing trends, volume changes, and which themes are driving shifts.

Prioritize

Declining themes and recurring complaints are surfaced as prioritized action items with supporting evidence from real reviews.

Why This Build

Why Sentiment Analysis?

Every hospitality and retail business is sitting on a goldmine of customer feedback. Google Reviews, Yelp, TripAdvisor, internal surveys — hundreds of unstructured text entries that nobody has time to read systematically.

Star ratings tell you the “what” but not the “why.” A 3-star review could mean “great food, terrible service” or “average everything.” The difference matters enormously for deciding what to fix first.

This pipeline extracts the themes that actually drive customer satisfaction. It shows you that “wait times” appear in 6 negative reviews and the trend is getting worse — while “food quality” is your strength with a 0.88 sentiment score. Ask one question, get a prioritized list of what to fix and what to protect. Second ML Engineering build of the challenge.

Demo Data

What's Inside

5

Businesses

66

Reviews

36

Themes

26

Snapshots

5

Sources

6

Weeks of Data

5 businesses across hospitality, food & beverage, restaurant, wellness, and resort industries. Reviews sourced from Google, Yelp, TripAdvisor, OpenTable, and internal surveys. Each business has distinct personality: strong service but aging facilities, great product but inconsistent quality, beloved instructors but broken booking app. Real patterns, realistic edge cases.

Setup

Try It Locally

cd day24-sentiment-analysis
npm install && npm run seed && npm run build

Then add the config to Claude Desktop and restart.

Want to know what your customers really think?

If you're reading reviews one at a time instead of seeing the patterns, let's build something that listens at scale.