What You’ll Build
A general-purpose research agent that searches across social media platforms — TikTok, Reddit, Instagram, X, Facebook, and LinkedIn — to gather real-world opinions, discussions, and insights on any topic. The agent strategically targets different platforms based on the kind of information it needs and synthesizes findings into a cited report.View Source on GitHub
Architecture
The agent callssearch_social_media multiple times with different queries and platform targets to build a complete picture before synthesizing.
Tools Used
| Tool | Platforms | Description |
|---|---|---|
search_social_media | TikTok, Instagram, Reddit, X, Facebook, LinkedIn, or combined | Searches social platforms with platform-specific targeting, time filtering, and optional raw content extraction |
platform— target a specific platform or search all with"combined"max_results— control how many results to fetchtime_range— filter by"day","week","month", or"year"include_raw_content— extract full post content for deeper analysis
Quick Start
- Anthropic SDK
- LangGraph
Source File
How It Works
Platform Strategy
Platform Strategy
The system prompt guides the agent to use platforms strategically:The agent typically makes 2-4 search calls, targeting different platforms or using different query angles to build comprehensive coverage.
Tool Configuration
Tool Configuration
The
search_social_media tool wraps tavily_agent_toolkit.social_media_search with these defaults:search_depth="advanced"for thorough content extractioninclude_answer=Trueto get an AI-synthesized summary alongside raw resultstime_range="month"as a sensible default for recency
Synthesis and Citations
Synthesis and Citations
After gathering results from multiple platforms, the agent synthesizes findings into a clear report with inline citations
[1], [2] and a sources list with URLs at the end.Example Interaction
Example Research Topics
- Product reviews and sentiment (“What do people think of the Dyson Airwrap?”)
- Trending discussions (“What’s viral on TikTok this week?”)
- Public opinion (“How do people feel about remote work?”)
- Event reactions (“What are people saying about the Super Bowl?”)
- Travel recommendations (“Best hiking spots according to Reddit?”)
- Brand perception (“How is Company X perceived on LinkedIn vs Reddit?”)
Key Parameters to Tune
| Parameter | Effect |
|---|---|
platform | Target a specific platform or "combined" for all. Use "reddit" for honest opinions, "tiktok" for trends. |
max_results | Number of results per search call (default: 10) |
time_range | "day" for breaking news, "month" for broader trends |
include_raw_content | true for full post text, false for snippets only |
Next Steps
Company Intelligence
Combine social media research with website crawling for full company analysis.
Tools Reference
Full documentation for social_media_search and all other tools.