The AI Insights panel transforms raw sentiment data into actionable strategic recommendations. It analyzes emotion distributions, crisis levels, and volume trends to generate professional reports tailored for PR teams, communications managers, and decision-makers.
Tertiary provider (if VITE_GROQ_API_KEY configured)Uses Llama 3.3 70B for fast inference. This tier exists in the codebase but is being phased out in favor of Gemini.
Guaranteed fallback (no API required)Generates reports using template-based analysis:
// Source: AIInsightsPanel.tsx (lines 248-289)function generateLocalInsight( topic: TopicCard, emotions: EmotionData[]): string { const topEmo = emotions[0]?.emotion || 'surprise'; const topPct = emotions[0]?.percentage || 40; const sentiment = topic.sentiment; const crisis = topic.crisisLevel; return `## Situation Assessment Public sentiment around **${topic.title}** is currently **${sentimentLabel}**, with **${topEmo} (${topPct}%)** as the dominant emotion. ## Recommended Actions 1. **Monitor and document** — track the ${topEmo} signals in real-time 2. **Engage proactively** — address leading concerns with transparent communication 3. **Segment your response** — tailor messaging to distinct emotional groups ... `;}
Advantages:
Always available, zero dependencies
Instant generation (no API latency)
Privacy-friendly (no external calls)
Limitations:
Template-based, less contextual than LLMs
Generic recommendations
The system tries each tier in order. If OpenAI fails (quota, network), it automatically falls back to Gemini, then Groq, then local generation.
## Situation AssessmentPublic sentiment around **AI Regulation Debate** is currently **divided**, with **fear (35%)** as the dominant emotion. Crisis level is **medium**, indicating elevated public concern. Volume has shifted **+42%**, suggesting rapidly escalating public engagement.
Purpose: Provides a 2-3 sentence snapshot of the current landscape.
## Recommended Actions1. **Monitor and document** — track the fear signals in real-time for early escalation warnings2. **Engage proactively** — address the leading concerns with transparent, factual communication via official channels3. **Segment your response** — tailor messaging to the distinct emotional groups (fear vs anger audiences)4. **Establish rapid response protocols** — Proactive monitoring and engagement is advised.5. **Measure sentiment shift** — set up hourly tracking alerts for #AIRegulation
Purpose: 4-5 specific, actionable steps. Each starts with an action verb and is implementable.
## Opportunities- The **35% fear** signal can be redirected into constructive dialogue if addressed proactively- Current volume spike (+42%) is an opportunity to own the narrative before it solidifies- Building credibility now through transparent communication will pay dividends when sentiment stabilizes
## Risk Factors to Monitor- **Escalation trigger**: A new development could push sentiment toward crisis level- **Narrative hijacking**: Third parties or media may amplify the anger signal to shift the story- **Sentiment fatigue**: Prolonged high-volume discourse without resolution leads to disengagement or backlash
Purpose: 2-3 things that could make the situation worse.
After generating a report, expand the “Ask More About This Analysis” section to chat with the AI:
How to Use
Example Conversation
Technical Details
Click “Ask More About This Analysis” to expand the chat panel
Type a question or click a suggested prompt:
“What should we prioritize first?”
“How can we address the anger?”
“What are the quick wins?”
Press Enter or click the Send button
The AI responds in context of the generated report
The chat maintains conversation history, so you can ask follow-up questions that reference previous answers.
User: What should we prioritize first?AI: Based on the sentiment data for AI Regulation Debate, prioritize addressing the fear (35%) response first. This is the dominant emotion and indicates public anxiety about job displacement and lack of oversight. Focus on:
Transparent communication about safeguards
Real-world examples of positive regulation outcomes (EU model)
Direct engagement with tech workers (3x more fearful than general public)
User: How can we address the anger?AI: The 28% anger stems from frustration with perceived government inaction and corporate monopoly concerns. Address it by:
Acknowledging the valid concerns publicly
Sharing concrete timelines for regulatory action
Highlighting small business support measures to counter “innovation killer” narrative
// Source: AIInsightsPanel.tsx (lines 37-67)const systemPrompt = `You are a senior PR and communications strategist. Analyze the following public sentiment data and provide balanced, actionable recommendations.Topic: ${topicName}Hashtag: ${hashtag}Overall Sentiment: ${sentiment}Crisis Level: ${crisis}Emotion Breakdown: ${emotionStr}Volume Change: ${change}Generate a professional analysis report with these sections:## Situation AssessmentBrief overview of the current public sentiment landscape (2-3 sentences).## Key Concerns Identified- Main issues driving sentiment (3-4 bullet points)## Recommended Actions4-5 actionable recommendations. Each should:- Start with a clear action verb- Be specific and implementable- Consider both immediate and long-term impact## Opportunities- 2-3 opportunities arising from this situation## Risk Factors to Monitor- 2-3 things that could escalate or shift the situationKeep the tone professional, balanced, and constructive.`;
// Source: AIInsightsPanel.tsx (lines 27-35)const systemPrompt = `You are an AI analyzing public sentiment data.Topic: ${topicName}Hashtag: ${hashtag}Overall Sentiment: ${sentiment}Crisis Level: ${crisis}Top Emotions: ${emotionStr}Answer questions concisely and directly. No filler, no pleasantries. Just precise answers.`;
Chat mode uses a more conversational tone and focuses on direct answers rather than full reports.
Scenario: AI regulation debate (35% fear, 28% anger)AI Recommendation:
## Recommended Actions1. **Segment messaging by audience** — Tech workers (fear-driven) vs general public (anger-driven)2. **Showcase international precedent** — EU regulation praised as template; position as learning from best practices3. **Address job displacement directly** — Publish reskilling programs, transition support initiatives
LLM hallucination risk: AI-generated recommendations are based on emotion percentages and keywords, not deep semantic understanding. Always cross-check with the raw Live Feed and Top Voices panels.No domain expertise: The AI doesn’t know your industry, brand history, or internal constraints. Treat recommendations as a starting point, not gospel.Static analysis: Reports are generated from a single snapshot. For evolving situations, regenerate every 6-12 hours.