Customer Sentiment Analysis Agent
Agent Description:
The Customer Sentiment Analysis Agentstreamlines the Voice of the Customer (VoC) workflow by initially parsing the user's intent to define the analysis scope. It then seamlessly retrieves and joins data from internal SQL databases and external API sources, semantically maps the feedback to known product features or issues, and calculates a definitive sentiment score. The workflow dynamically branches to deeply analyze either the root causes of negative sentiment or the highlights of positive praise based on the aggregate score.
- Purpose: This agent is designed to empower customer support and product
teams by automatically ingesting, contextualizing, and analyzing customer
feedback across multiple channels. It enables organizations to transform
scattered product reviews, support tickets, and survey responses into coherent,
actionable business intelligence without manual data crunching.
The agent improves product development and customer success strategies by providing:
-
Unified extraction of feedback from diverse sources (tickets, surveys, reviews, chats).
-
Contextual enrichment linking raw feedback to specific product features or known issues.
-
Objective sentiment scoring (-1 to +1) and percentage distribution.
-
Automated deep-dives into critical pain points or winning features via conditional routing.
-
Executive-ready, business-friendly sentiment reports.
-
- Components:
-
Query Understanding Agent: Parses the user's initial request to identify the target product, time range, and analysis goal.
-
Feedback Data Retrieval Agent: Uses SQL to fetch, join, and clean feedback data from multiple tables.
-
Context Retriever Agent: Pulls product context via API and semantically maps feedback to features and known issues.
-
Sentiment Analysis Agent: Classifies emotions, computes sentiment scores, and extracts key themes.
-
Sentiment Router Agent: Acts as a logical switch to route the dataset based on whether the overall sentiment is positive/neutral or negative.
-
Good Sentiment Analyzer: Focuses exclusively on positive entries to identify strengths and praised features.
-
Bad Sentiment Analyzer: Focuses exclusively on negative entries to determine severity and critical pain points.
-
Insight Reporter: Synthesizes the analysis into a concise, readable final report.
-
-
Natural language intent parsing for target scoping
-
SQL database querying and cross-table joins (Reviews, Tickets, Surveys, Products)
-
External REST API integration for product context retrieval
-
Semantic matching of feedback to specific product features
-
Numerical sentiment scoring (-1 = Negative, 0 = Neutral, +1 = Positive)
-
Conditional workflow routing based on threshold scores (sentiment_score < 0 vs >= 0)
-
Automated deduplication and noise filtering
-
Executive summary generation
-
OpenAI GPT_40_MINI for both the parent agent and its sub-agents.
This template is ideal for product managers, customer success leads, and support operations teams who need to transform massive volumes of unstructured feedback into strategic business improvements.
Sub-Agents
1. Query Understanding Agent
-
Role:Intent parsing
-
Scope:Understand what sentiment analysis the user wants.
-
Description: Extracts the analysis goal, target product, time range, and feedback sources from the user's prompt. Applies reasonable defaults if parameters are missing before passing the context downstream.
-
LLM Used: Default (Inherits from parent agent).
2. Feedback Data Retrieval Agent
-
Role:Data acquisition
-
Scope:Collect all relevant customer feedback.
-
Description: Uses the SQL Toolkit to join customer_feedback, support_tickets, and surveys tables. Normalizes text into a unified feedback_text field, removes duplicates/system messages, and outputs a clean dataset.
-
LLM Used: Default (Inherits from parent agent).
3. Context Retriever Agent
-
Role:Context enrichment
-
Scope:Understand product context behind feedback.
-
Description:Uses the requests_get tool to retrieve product features and known issues. Semantically maps the feedback to these features (for example, matching "upload is very slow" to "slow upload speeds").
-
LLM Used: Default (Inherits from parent agent).
4. Sentiment Analysis Engine
-
Role:Sentiment detection
-
Scope:Analyze emotions and themes in feedback.
-
Description:Classifies feedback, assigns numerical scores, and calculates percentage distributions. Identifies key themes and major issues using the mapped product context.
-
LLM Used: Default (Inherits from parent agent).
5. Sentiment Router Agent
-
Role: Decision Routing
-
Scope:Route analysis based on overall sentiment score.
-
Description:A logical gatekeeper that inspects sentiment_score. Routes to the Bad Sentiment Analyzer if < 0, or to the Good Sentiment Analyzer if >= 0.
-
LLM Used: Default (Inherits from parent agent).
6. Good Sentiment Analyzer
-
Role: Positive Insights
-
Scope:Analyze positive sentiment deeply.
-
Description:Filters for positive feedback only. Identifies the most loved features and product strengths without making recommendations or highlighting negative data.
-
LLM Used: Default (Inherits from parent agent).
7. Bad Sentiment Analyzer
-
Role: Issue Deep Dive
-
Scope:Analyze negative sentiment deeply.
-
Description:Filters for negative feedback only. Identifies critical failures, frequent complaints, and assesses the overall severity level (high or medium) of the pain points.
-
LLM Used: Default (Inherits from parent agent).
8. Insight Reporter
-
Role: Report Generation
-
Scope:Generate final readable sentiment report.
-
Description:Compiles the overall sentiment distribution and the routed deep-dive insights into a final, business-friendly "Customer Sentiment Report."
-
LLM Used: Default (Inherits from parent agent).
- SQL - Toolkit: Executes customer_sentiment_sql.sql to pull and join customer reviews, tickets, and surveys from internal databases.
- Request - Get: Polls the customer_sentiment_input.json endpoint to fetch product context and features.
-
Intake & Scoping: The Query Understanding Agent defines parameters (for example, "Analyze CloudSync Pro for the last 30 days").
-
Retrieval: The Feedback Data Retrieval Agent queries the SQL database to pull all relevant tickets and surveys into a cleaned dataset.
-
Enrichment: The Context Retriever Agent maps user complaints (for example, "login fails") to known product parameters (for example, "SSO Integration").
-
Analysis & Scoring: The Sentiment Analysis Agent scores the batch. If the average score is +0.45 (Positive), it goes to the Good Sentiment Analyzer. If -0.20 (Negative), it goes to the Bad Sentiment Analyzer.
-
Final Output: The Insight Reporter synthesizes the scores and the deep-dive insights into a clean, executive-ready Markdown summary.
- “What is the overall sentiment for CloudDrive Storage?”
- “Analyze customer sentiment for SecureMail Pro”
- “Give me sentiment analysis for DataAnalytics Hub”