How to Run Social Media Sentiment Analysis with an AI Agent
Ask an AI agent "what's the sentiment around our brand this week?" and, with the right skill installed, you get back a classified report: an overall score, a positive/neutral/negative split per platform, the recurring themes with representative quotes, and the highest-engagement posts driving the numbers. The whole loop, from fetching real posts to the finished report, runs inside one conversation.
The skill doing the work in this tutorial is social-sentiment-analyzer, from our open-source agent skills collection at Xpoz. It reads posts from the Xpoz index of Twitter/X, Reddit, and Instagram (billions of posts, free tier available) and encodes the classification and reporting workflow below. The approach transfers: any agent with social data access can follow the same recipe.
Why an Agent Instead of a Dashboard or a Script
Sentiment tooling historically came in two shapes. Suite dashboards (Brandwatch, Talkwalker, Sprout Social) bundle sentiment into enterprise listening platforms: polished, continuous, priced for teams. DIY pipelines (VADER, spaCy, transformer models) are free and controllable but leave you to solve data access, which is the genuinely hard part since platform APIs got expensive.
An agent skill occupies a third position. The language model does the classification, the skill supplies the method, and an indexed data layer supplies the posts. The practical differences, stated factually:
| Approach | Strength | Trade-off |
|---|---|---|
| Suite dashboards | Continuous tracking, alerting, team features | Enterprise pricing; fixed report shapes |
| DIY NLP pipeline | Full control, free classifiers | You must source the data; engineering time |
| Agent + skill | Conversational, context-aware classification, minutes to start | Bounded by the data layer's platform coverage |
The classification difference is concrete: dictionary-based scorers rate "Great, another outage" as positive because "great" is a positive word. A language model reads the sarcasm. The skill leans into that by using a 5-level scale (positive, leaning positive, neutral, leaning negative, negative) instead of a binary, and by weighting high-engagement posts more heavily, since a complaint with 4,000 likes is a different fact than the same complaint with 4.
What the Skill Actually Does
When a request matches ("what are people saying about [brand]?", "is the reaction to the launch positive?"), the skill runs four steps:
- Expand the query. "Tesla" becomes
"Tesla" OR "$TSLA"; product names pick up their common abbreviations; events pick up their hashtags. Coverage lives or dies here. - Fetch real posts from Twitter/X and Reddit by default (Instagram on request) over the analysis window, defaulting to the last 7 days, with engagement fields included.
- Classify and theme. Each post gets one of the five levels; then the skill extracts 5-8 recurring themes, each with its own sentiment lean, volume share, and 2-3 representative quotes.
- Report. Overall score, platform breakdown, themes, notable posts, and a short executive summary.
Platform texture matters and the report keeps it: Reddit runs longer and more nuanced, Twitter/X higher-volume and sharper, so a brand can read positive on one and negative on the other for the same week. That split is usually the most actionable line in the report.
Setup and First Run
Install the skill (Claude Code shown; any SKILL.md-compatible agent works):
git clone https://github.com/XPOZpublic/xpoz-agent-skills.git
cp -r xpoz-agent-skills/skills/social-sentiment-analyzer ~/.claude/skills/
Connect data access, either the remote MCP server or an SDK key from xpoz.ai/get-token (free tier, up to 75,000 results):
claude mcp add --transport http --scope user xpoz https://mcp.xpoz.ai/mcp
Then ask:
"Analyze sentiment around NVIDIA this week on Twitter and Reddit"
"How are people feeling about Cursor on Reddit?"
"Is the reaction to the new iPhone positive or negative?"
"Sentiment for Bitcoin over the last 30 days"
Follow-up questions stay in the conversation: "show me the negative themes only", "what changed versus the prior week?", "pull the top complaints as a table". That conversational drill-down is what dashboards can't do.
Try this with Xpoz
No API keys needed. Query Twitter, Reddit, Instagram & TikTok with natural language.
FAQ
How do I run sentiment analysis on posts about my brand?
Ask an agent with a sentiment skill and social data access: it fetches real posts from Twitter/X, Reddit, and Instagram, classifies each into a 5-level scale, extracts themes, and returns a structured report with quotes and engagement-weighted scores.
Is AI sentiment classification accurate?
Language-model classification reads context, which is where dictionary tools break on sarcasm and negation. It is still probabilistic: treat single-post labels as noisy, treat aggregate scores as the signal, and spot-check a sample before trusting a new setup.
Can I run sentiment analysis for free?
Yes, within limits. The skill is open source, and the Xpoz free tier includes up to 75,000 results with no credit card. Paid plans start at $20/month when volume grows.
How many posts do I need for a reliable read?
A few hundred posts across platforms give a stable overall score and surface the main themes. With only a few dozen, quotes are valuable but percentages are shaky, and a good report says so.
Next Steps
- Comparing dedicated tools instead? The market is mapped in Best Sentiment Analysis Tools for Social Media.
- Reddit-specific methods, including score-and-comment dynamics, are in Reddit Sentiment Analysis: Tools and Methods.
- The full skills collection, install pattern included: How to Add Social Media Skills to Your AI Agent.




