Skip to main content

Overview

Social Pulse brings real-world social media discussion into your argument analysis. It automatically searches X (Twitter) for conversations related to your topic, then uses AI to summarize the public sentiment and key discussion points.
Think of it as getting a “Grok-style” summary of what people are actually saying about your topic on social media, complementing the structured academic analysis.

How It Works

1

Query Generation

When you analyze a topic, the system generates a concise 2-4 word search query from your input
2

Twitter Search

The twitterSearch tool fetches recent, relevant tweets using the generated query
3

Engagement Sorting

Tweets are sorted by engagement metrics (likes, retweets, replies) to surface the most impactful conversations
4

AI Summarization

The socialPulsePrompt analyzes tweet content to generate a neutral summary of sentiment and themes

The Social Pulse Summary

The AI-generated summary captures:

Public Sentiment

Overall emotional tone of the discussion (supportive, critical, mixed, curious)

Key Discussion Points

Main themes and topics people are talking about

Emerging Themes

New angles or perspectives surfacing in social conversation

Community Concerns

Specific worries, questions, or interests being voiced

Example Summary

The conversation around AI regulation shows a divide between 
technology enthusiasts worried about innovation slowdown and 
safety advocates calling for immediate oversight. Key concerns 
include data privacy, job displacement, and autonomous weapons. 
Many users reference recent AI incidents as evidence for their 
positions, while others cite economic competitiveness fears.
The summary style mirrors the “Grok” feature on X/Twitter - conversational yet informative, capturing the zeitgeist of the discussion.

Tweet Display

The Social Pulse panel shows up to 5 top tweets, each displayed as a rich TweetCard:

Tweet Card Components

type Tweet = {
  id: string;
  text: string;
  author: {
    name: string;
    username: string;
    profile_image_url: string;
  };
  public_metrics: {
    retweet_count: number;
    reply_count: number;
    like_count: number;
    impression_count: number;
  };
  created_at: string;
}

Visual Layout

┌─────────────────────────────────────┐
│ [@profile_pic] @username            │
│ Display Name                        │
│                                     │
│ Tweet text content goes here and    │
│ can span multiple lines...          │
│                                     │
│ 💬 23  🔁 45  ❤️ 156               │
│ 2 hours ago                         │
└─────────────────────────────────────┘
  • Profile picture
  • Display name
  • @username handle
  • Links to the original tweet
  • Full tweet text
  • Properly formatted with line breaks
  • Links and hashtags preserved
  • Reply count (💬)
  • Retweet count (🔁)
  • Like count (❤️)
  • Timestamp

Social Pulse Panel

The Social Pulse appears as a slide-in panel on the right side of the analysis view:

Panel Features

1

Toggle Button

Click the message icon in the toolbar to open/close the panel
2

Summary Section

AI-generated summary appears at the top in a dashed border box
3

Tweet Stream

Scrollable list of top tweets sorted by engagement
4

Smooth Animation

Panel slides in from the right with smooth transitions

Panel Behavior

// Panel state management
const [isSocialOpen, setIsSocialOpen] = useState(false);

// Smooth slide-in animation
initial={{ x: '100%', opacity: 0 }}
animate={{ x: 0, opacity: 1 }}
exit={{ x: '100%', opacity: 0 }}
transition={{ duration: 0.3, ease: 'easeInOut' }}
The panel is non-intrusive - it slides away when you need more space for the main visualization, and slides back when you want social context.

Engagement Sorting

Tweets are intelligently ranked to show the most impactful conversations:

Sorting Algorithm

// Sort by like count (primary engagement signal)
const sortedTweets = twitterResult.sort(
  (a, b) => b.public_metrics.like_count - a.public_metrics.like_count
);

// Return top 5 most-liked tweets
return tweets.slice(0, 5);

Why Like Count?

Signal Quality

Likes indicate agreement or value, filtering out noise

Representative Voices

High-engagement tweets represent broader community sentiment

Diverse Perspectives

Popular tweets often come from different viewpoints

Conversation Starters

Well-liked tweets tend to spark meaningful discussion

Graceful Fallback

Social Pulse is designed to never break your analysis:

No Tweets Available

When no relevant tweets are found, you’ll see a friendly message:
┌───────────────────────────────┐
│         [Twitter Icon]        │
│                               │
│  "X seems shy right now.      │
│   Check back soon!"           │
└───────────────────────────────┘
Fallback messages include:
  • “X seems shy right now. Check back soon!”
  • “The feed’s taking a quick power nap.”
  • “No trending tweets at the moment — maybe it’s a Zen hour.”
  • “Looks like a quiet moment on the timeline. Enjoy the calm!”
  • “The digital town square is empty. Let’s start a conversation!”

Error Handling

If Twitter search fails, the main analysis continues unaffected:
try {
  // Attempt Twitter search and summarization
  const twitterResult = await twitterSearch({ query: searchQuery });
  // ... process tweets
} catch (error) {
  console.error("Twitter search failed, continuing with main analysis.");
  // Gracefully fail - socialPulse and tweets remain empty
}
Social Pulse is a bonus feature - if it’s unavailable, you still get the complete argument analysis, summary, and insights.

AI Summary Generation

The socialPulsePrompt analyzes tweet content with specific instructions:

Prompt Guidelines

Summaries must be objective and balanced, avoiding bias toward any particular viewpoint
Extract main themes and patterns from the collection of tweets
Describe the overall emotional tone without exaggeration
Write in a conversational yet informative style similar to X’s Grok feature

Summary Process

const socialPulsePrompt = ai.definePrompt({
  input: { schema: z.object({ tweets: z.array(z.string()) }) },
  output: { schema: z.object({ socialPulse: z.string() }) },
  prompt: `Analyze the following tweets and write a brief, 
           neutral summary of the public sentiment and key 
           discussion points...`
});

Use Cases

Understand how public opinion on a topic is evolving in real-time social media conversations
Connect formal argument structures to how real people discuss the topic
Discover practical concerns and questions people have that may not appear in formal sources
Get a quick read on whether public sentiment leans positive, negative, or mixed
Discover influential voices and thought leaders in the conversation

Privacy & Transparency

Public Data Only

Only publicly available tweets are fetched - no private information

Attribution

All tweets show original authors with links to source

AI Disclaimer

Summary includes note that AI can make mistakes and outputs should be verified

No Tracking

No user data is collected or stored from social media

Disclaimer Text

This story is a summary of posts on X and may evolve over time. 
AI can make mistakes, so verify its outputs.
The disclaimer appears directly below the Social Pulse summary, ensuring users understand the AI-generated nature of the content.

Integration with Main Analysis

Social Pulse complements the structured argument analysis:
FeatureMain AnalysisSocial Pulse
SourceAcademic, news, officialSocial media, public opinion
ToneFormal, structuredCasual, conversational
FormatHierarchical argumentsNarrative summary + tweets
PurposeLogical deconstructionSentiment & themes
VerificationSource URLs + quotesTweet links + metrics

Complementary Insights

1

Formal Structure

Main analysis provides rigorous logical breakdown
2

Public Reaction

Social Pulse shows how people actually respond to the topic
3

Gap Identification

Compare formal arguments to public concerns to find missing perspectives
4

Complete Picture

Together they provide both academic rigor and real-world context

Best Practices

Verify Claims

Social media reflects opinion, not fact - verify important claims

Consider Bias

Twitter demographics may not represent general population

Check Timestamps

Social sentiment can change rapidly - note when tweets were posted

Follow Links

Click through to original tweets for full context
Use Social Pulse as a complement to formal analysis, not a replacement. It shows what people are saying, which may differ from what experts conclude.

What’s Next?

Explore other analysis features:

Argument Analysis

Understand how the AI deconstructs topics into structured arguments

Visual Mapping

Explore interactive tree visualizations of arguments

Fallacy Detection

Identify logical errors in reasoning

Build docs developers (and LLMs) love