Analyze social media engagement and store insights for future content
Analyze LinkedIn and X engagement from the past week, identify patterns, and store insights to the knowledge base for the content engine and newsletter writer.
Get channel info — Call postiz_channels to get integration IDs for LinkedIn and X.
Pull analytics — Call postiz_analytics for each channel with days: 7.
Pull recent posts — Call postiz_list_posts with a date range covering the last 7 days to get actual post content alongside the analytics.
Analyze performance — For each platform, identify:
Extract actionable insights — Synthesize into concrete recommendations:
Store to knowledge base — Call knowledge_store with:
title: "Engagement Insights — Week of [date]"content: Full analysis including metrics, top/bottom posts, patterns, and recommendationstags: ["engagement-insights", "top-performing-content", "week-YYYY-WW"]Report to user — Present a summary:
**Engagement Report — Week of [Date]**
**LinkedIn Performance**
- Total impressions: [N]
- Total engagements: [N]
- Top post: "[excerpt]" — [metrics]
- Trend: [up/down/stable] vs last week
**X Performance**
- Total impressions: [N]
- Total engagements: [N]
- Top post: "[excerpt]" — [metrics]
- Trend: [up/down/stable] vs last week
**Key Insights**
1. [Insight about what's working]
2. [Insight about what to change]
3. [Insight about audience preferences]
**Recommendations for Next Week**
- [Specific recommendation 1]
- [Specific recommendation 2]
- [Specific recommendation 3]