
AI Newsletter Automation Agent
A purpose-built AI automation dashboard designed to eliminate the manual work behind weekly newsletter creation. The system runs a multi-stage pipeline: Apify scrapes the web and social media for content on user-defined topics, Exa and Tavily handle semantic search to surface the most relevant articles and reports, and an LLM (routed through OpenRouter) summarizes sources, detects trends, and generates a full newsletter draft — complete with subject line variations, a hook, thematically segmented sections, and a CTA — all matching the client's writing tone. Mem0 persists style decisions and format preferences across every run so no preference needs to be re-explained. Before anything goes live, the client reviews and edits the draft directly in the dashboard. Due to LinkedIn's platform restriction (no third-party Newsletter API), and Substack's lack of a public API, the final publish step is a deliberate one-click copy-paste — but all the research, writing, and structure work is fully automated. The same configurable pipeline works for multiple content angles without any code changes.
The Story
The Problem
Creating a weekly newsletter from scratch is a multi-hour process: researching trending topics, collecting and reading sources, summarizing insights, writing a draft that matches a specific tone, and then formatting it for both LinkedIn and Substack. There was no system that could automate this research-to-draft pipeline while remembering past style decisions and keeping a human in control before publishing.
The Solution
Built a dedicated Next.js dashboard where the client sets topics, source URLs, and keywords. The research pipeline (Apify + Exa/Tavily) collects and semantically ranks content, which is then summarized and fed to an LLM via OpenRouter. The LLM generates a full newsletter draft tuned to the client's voice, stored preferences are retrieved from Mem0 on every run, and the draft appears in the dashboard for inline review and editing. Approved content is formatted for both LinkedIn Newsletter (manual paste) and Substack (copy block). The platform is fully configurable per run — no code changes needed to switch topics or content angles.
My Approach
Designed a modular, configurable pipeline with clear stage separation: topic ingestion → web scraping & semantic search → summarization → LLM draft generation with style memory → human review gate → formatted output blocks. Built to be reusable across different content angles without code changes.
Vision & Objectives
- •Automate the research-to-draft pipeline end-to-end for weekly newsletters
- •Persist writing style and format preferences so every run stays on-brand
- •Keep the human in control with an explicit review gate before any content is published
- •Support multiple platforms (LinkedIn Newsletter, Substack) from a single dashboard
- •Enable topic and source switching via dashboard config — no code changes required
Technology Stack
Frontend
- •Next.js – Dashboard UI deployed on Vercel
- •TypeScript – Type-safe component and pipeline logic
- •Tailwind CSS – Clean, responsive dashboard layout
Backend & Infrastructure
- •Supabase – Database for storing drafts, run history, and user config
- •Next.js API Routes – Serverless pipeline orchestration
- •Vercel – Hosting and deployment
AI & Intelligence Layer
- •OpenRouter – LLM routing for draft generation (cheap/free model selection)
- •Apify – Web and social media scraping for topic research
- •Exa / Tavily – Semantic AI search for surfacing relevant articles and reports
- •Mem0 – Memory layer that persists the client's tone, style decisions, and format preferences across runs
Payments & Integrations
- •Publer – LinkedIn regular post publishing (Newsletter issues require manual paste due to LinkedIn API restrictions)
- •Substack – Formatted copy block for manual paste (no public API)
Core Platform Modules
A. Content Research & Ingestion
Configurable research pipeline that pulls content from the web and social media based on user-defined topics, keywords, and source URLs.
- •Apify-powered web and social media scraping
- •Exa / Tavily semantic search for relevant articles and reports
- •Configurable topic inputs, keywords, and source URLs
- •Output: ranked list of collected articles with metadata
B. Trend Detection & Summarization
Identifies trending topics within the niche and summarizes collected sources into concise digests used as LLM input context.
- •Trend detection across collected sources
- •Per-article summarization for noise reduction
- •Key facts and insights extraction
- •Structured digest as LLM input context
C. Newsletter Draft Generation
LLM-powered draft generation via OpenRouter that matches Katerina's writing tone, with style memory retrieved from Mem0 on every run.
- •Full weekly newsletter draft via OpenRouter LLM
- •3–5 subject line variations
- •Intro / hook, thematic sections, outro / CTA
- •Tone and style matched via system prompt
- •Mem0 retrieves stored preferences on every run
- •Style corrections and format changes persisted for future runs
D. Human Review Gate
Dashboard view for reviewing, editing, and approving drafts before any content is published. Nothing goes live without explicit approval.
- •Full draft preview in dashboard
- •Inline editing before approval
- •Approve / reject / re-generate controls
- •No content publishes without explicit user action
E. Publishing & Output
Formatted output blocks for LinkedIn Newsletter (manual paste) and Substack (copy block). Publer handles regular LinkedIn posts if needed.
- •LinkedIn Newsletter formatted draft (manual paste — LinkedIn API restriction)
- •Substack-ready formatted copy block
- •Publer integration for regular LinkedIn posts
- •One-click copy for each platform
Advanced System Capabilities
- •End-to-end research automation: scraping, semantic search, trend detection, summarization
- •LLM draft generation with persistent style memory (Mem0)
- •Human-in-the-loop review and editing before publish
- •Configurable per run — topics, sources, and angles switchable from the dashboard
- •Dual-platform output: LinkedIn Newsletter + Substack
- •Near-zero LLM cost via OpenRouter free/cheap model routing
- •No code changes needed to switch content angles or topics
System Architecture Principles
- •Dashboard (Next.js + Vercel) → user sets topics/keywords/sources → triggers research pipeline
- •Research: Apify scrape + Exa/Tavily semantic search → ranked article list
- •Processing: summarization → trend detection → LLM draft generation (OpenRouter) + Mem0 style retrieval
- •Review gate: draft shown in dashboard → inline edit → approve
- •Output: LinkedIn Newsletter copy block + Substack copy block; Publer for regular LinkedIn posts
Value Proposition
- •For the Client: Hours of manual research and writing reduced to a single 'Run Research' click, with full control at the approval step
- •For Audience: Consistently on-brand, well-researched newsletter content published on schedule
- •For Replicability: Same pipeline runs for any topic angle — just update config in the dashboard, no engineering required