Westnode

Trendwire

Backend editorial intelligence for Reddit. Trendwire runs as a scheduled pipeline that turns Reddit activity, historical context, and LLM analysis into structured editorial briefs.

2 LLM passes
50 posts per run
SQLite run memory
trendwire --slot morning --email
fetch -> classify -> synthesize
write -> persist -> deliver

Built as a backend operating system for editorial signal

Trendwire is a scheduled Python pipeline for turning noisy Reddit activity into structured, reviewable briefs. It avoids a web-app dependency by running as a one-shot backend job with a lock file, clear output artifacts, and deployable Docker execution.

01 Markdown brief

Readable editorial output for each published run.

02 JSON summary

Structured run data with takeaways, candidates, and source comments.

03 Email and Slack

Optional delivery after primary files and database updates complete.

Architecture Flow

The system keeps source discovery, analysis, persistence, and delivery as explicit stages so each run can be inspected, retried, and extended without changing the whole pipeline.

CLI Slot, source, cleanup, and delivery flags
Reddit ingest Multireddit snapshots or manual Texas search
Analysis Classification, rule scoring, and synthesis
Persistence Runs, posts, comments, ranks, and flags
Outputs Markdown, JSON, email, and Slack artifacts

Delivery Surfaces

Backend work is still visual when the outputs are clear. This section shows the shape of the generated brief alongside the delivery artifacts produced by each run.

Subject: Texas Morning Brief

Top 5 takeaways

Strongest possible source

Comment context, link, and editorial note render from structured data.

Generated artifacts

  • .md Human-readable brief
  • .json Structured run payload
  • .email.html Delivery-ready HTML email
  • .email.txt Plain text fallback

Implementation Details

The core keeps provider contracts narrow and orchestration readable. The snippets below show how the pipeline separates source data, analysis, and provider-specific LLM behavior.

Pipeline orchestration
classifications = classify_posts_with_retry(
    provider,
    [thread.post for thread in threads],
)

analysis = run_analysis(
    provider,
    AnalysisInputs(
        threads=threads,
        historical_context=historical_context,
        classifications_override=classifications,
    ),
)
LLM provider contract
class LLMProvider(Protocol):
    def classify_posts(
        self,
        posts: list[IngestedPost],
    ) -> list[PostClassification]: ...

    def synthesize(
        self,
        classified_posts: list[ClassifiedPost],
        notable_comments: list[NotableCommentInput],
        historical_context: HistoricalContext | None,
    ) -> SynthesisResult: ...

Technology Stack

Trendwire is a Python backend application designed for reliable scheduled execution:

Runtime
Python CLI with Docker Compose support
Data Source
Reddit API via PRAW
AI Providers
Supports Claude, ChatGPT, Gemini, and local models
Storage
SQLite with run, post, comment, and persistence tables
Outputs
Markdown briefs, JSON summaries, email artifacts, and Slack notifications