How liyedanpdx/reddit-ai-trends works
Reddit AI Trend Reports collects posts from configured communities, enriches them with comments and optional image, video, and web analysis, then generates dated English and Chinese trend reports. The central runtime entry point is report_generation.py; it coordinates collection, report processing, and persistence. The README also documents historical backfills, cached enrichment, and automatic latest-report links. Some collection-stage wiring and storage details are unsampled, so uncertain relationships are omitted or marked unverified.
Main entry points: report_generation.py Report Orchestrator · collector.py Reddit Collector · enrichers Content Enrichers · report_processor.py Report Processor
Components 22
Reddit Collection
- Reddit Collector
services/reddit_collection/collector.py - Reddit API Client
services/reddit_collection/client.py - Post and Comment Fetchers
services/reddit_collection/fetchers - Reddit Data Models
services/reddit_collection/models.py - Post and Comment Filters
services/reddit_collection/filters
Enrichment and Analysis
- Content Enrichers
services/reddit_collection/enrichers - Image Analysis
services/image_analyzer.py
Report Generation
- Report Orchestrator
report_generation.py - Runtime Configuration
config.py - Report Processor
services/llm_processing/report_processor.py - Prompt Loader
services/llm_processing/core/prompt_loader.py - LLM Provider Factory
services/llm_processing/core/factory.py - Groq Client
services/llm_processing/clients/groq_client.py - OpenRouter Client
services/llm_processing/clients/openrouter_client.py
Persistence and Backfill
- MongoDB
database/mongodb.py - Report Files
services/llm_processing/report_processor.py - Historical Backfill
backfill/backfill_reports.py
Other components
- Operator
- Daily Trigger
- LLM APIs
- Firecrawl
- YouTube Transcripts
Connections 27
- Operator → Report Orchestrator: runs
README.md - Daily Trigger → Report Orchestrator: triggers
report_generation.py - Report Orchestrator → Reddit Collector: collects posts
report_generation.py - Report Orchestrator → Report Processor: generates reports
report_generation.py - Report Orchestrator → MongoDB: persists reports
report_generation.py - Report Orchestrator → Runtime Configuration: reads settings
report_generation.py - Reddit Collector → Reddit API Client: uses API client
services/reddit_collection/collector.py - Reddit Collector → Post and Comment Fetchers: dispatches fetching
services/reddit_collection/collector.py - Post and Comment Fetchers → Reddit API Client: requests Reddit data
services/reddit_collection/fetchers/post_fetcher.py - Post and Comment Fetchers → Reddit Data Models: creates models
services/reddit_collection/fetchers/post_fetcher.py - Reddit Collector → Content Enrichers: enriches posts
services/reddit_collection/collector.py - Reddit Collector → Post and Comment Filters: filters posts
services/reddit_collection/collector.py - Reddit Collector → Image Analysis: analyzes images
services/reddit_collection/collector.py - Content Enrichers → MongoDB: caches enrichment
- Content Enrichers → Firecrawl: scrapes pages
- Content Enrichers → YouTube Transcripts: fetches transcripts
- Content Enrichers → LLM APIs: summarizes content
- Image Analysis → LLM APIs: analyzes images
- Report Processor → LLM Provider Factory: creates client
services/llm_processing/report_processor.py - Report Processor → Prompt Loader: loads prompts
- LLM Provider Factory → Groq Client: selects provider
services/llm_processing/core/factory.py - LLM Provider Factory → OpenRouter Client: selects provider
services/llm_processing/core/factory.py - Groq Client → LLM APIs: generates text
services/llm_processing/clients/groq_client.py - OpenRouter Client → LLM APIs: generates text
services/llm_processing/clients/openrouter_client.py - Report Processor → Report Files: writes reports
services/llm_processing/report_processor.py - Historical Backfill → MongoDB: reads historical data
backfill/backfill_reports.py - Historical Backfill → Report Orchestrator: regenerates reports
backfill/backfill_reports.py