Correlate social media sentiment and customer messages
Workflow purpose
This guide demonstrates how to use Proto's platform to correlate public social media sentiment with the messages your AI agent is already handling in the Inbox. Support volume alone only tells half the story – a spike in tickets about a specific product or policy often has a matching spike in public sentiment. Insight Advisor pulls both signals into a single workflow so analysts get a combined read without exporting data to a spreadsheet first.
Who can benefit from this guide:
- Regulators and central banks monitoring public reaction to a policy change
- Enterprise CX teams tracking brand sentiment alongside support volume
- Communications teams preparing briefings for leadership
- Analysts who currently cross-reference Perception and Inbox data by hand
Correlate sentiment and message volume
This workflow lets an analyst ask Insight Advisor for a sentiment-versus-volume view and receive a plain-language correlation summary in chat. See how to correlate social media sentiment and customer messages.
1. Create a trigger
Purpose: Start the flow when someone asks Insight Advisor to compare sentiment and message data.
- Navigate to the Actions tab in the AI agent settings.
- Click “+ Add Trigger” and select the Message Received trigger type.
- Name the trigger “Sentiment correlation”.
- Add a description such as “Triggers when the user asks to compare social sentiment with customer messages” so the LLM can match the intent.
2. Survey – scope the request
Purpose: Capture the time window and topic before running the correlation.
- Add a Survey action titled
Correlation scope. - Field
date_range– Text – What time period should I look at (e.g. last 30 days)? - Field
keyword– Text – Which topic or keyword should I focus on?
3. Pull the two data sources
Purpose: Retrieve sentiment data and message data for the same window.
- Add a Send API request action to Perception, filtered by
{keyword}and{date_range}. Map the response tosentiment_data. - Add a second Send API request action to your Inbox/Analytics export, filtered the same way. Map the response to
message_data.
4. LLM action – correlate the data
Purpose: Turn two raw datasets into one plain-language summary.
- Add an LLM action named
Correlation summary. - Input text:
{sentiment_data} {message_data}. - Output variable:
correlation_summary. - Success branch: add a Set chat variable action first –
correlation_summary = _.json_parse(correlation_summary)– before any field is read. - System prompt should ask for a
headline(one sentence), atrend(rising/falling/flat), and anotable_spikefield (string or null).
5. Send the insight
Purpose: Deliver the correlation in chat, ready to paste into a briefing.
- Add a Send message action: “{correlation_summary[“headline”]} Trend: {correlation_summary[“trend”]}. {correlation_summary[“notable_spike”]}“
6. Test the flow
Purpose: Confirm the correlation holds up against a known reporting period.
- Run the flow against a period you’ve already reported on manually and check the headline matches your own read of the data.
- Test with a keyword that has almost no social mentions, to confirm the LLM action still returns a graceful “not enough data” response rather than guessing.
- Test with a very wide date range to confirm the API requests don’t time out.