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,
),
) 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.
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.
Readable editorial output for each published run.
Structured run data with takeaways, candidates, and source comments.
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.
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
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.
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