Architecture
TrendRadar consists of two parts: the main program and the MCP analysis service. The main program handles data collection, processing, and pushing; the MCP service provides AI-based data query and analysis capabilities.
The main program's three-stage pipeline
The main program's core workflow is divided into three stages, executed in order on each run:
Stage 1: Data collection
Fetch raw information from three data sources: trending boards via the newsnow API (Zhihu, Weibo, Douyin, Baidu, etc.), configured RSS/Atom feeds, and scheduled open-web searches defined in
search_queries.txt — each persisted into dedicated SQLite databases.Stage 2: Data processing
Hotlists and RSS go through keyword matching or AI filtering, weighted ranking, and incremental deduplication. Web search results bypass keyword filtering and pass through a quality funnel (relevance score, site authority, freshness window, and cross-day deduplication).
Stage 3: Output and push
Generates minimalist HTML reports (automatically sanitized for email clients before mailing) and dispatches messages in parallel to configured push channels. When enabled, AI analysis (including Web Search Topic Insights) is appended and selected regions are translated into the target language.
Data flow
The diagram below shows the complete journey of data from collection to final output:
Data sources (newsnow API / RSS feeds / Web Search API)
|
v
Data collection module (SQLite: news / rss / search)
|
v
Keyword matching / AI filter / Web Search quality funnel
|
v
Scoring, deduplication & incremental detection
|
+----+----+--------+
| | |
v v v
HTML report Push msg AI analysisMCP analysis service
The MCP Server is a standalone service that provides AI chat-based data query, analysis, and retrieval built on the Model Context Protocol. It runs separately from the main program and can be deployed independently.
Capabilities: provides 31 tool functions and 5 config resources covering local hotlist, RSS, and web search archive queries, trend analysis, on-demand live web search (
live_web_search), and dual-engine article reading (read_article).Communication: supports two communication protocols:
HTTP-- exposes an HTTP interface on port 3333, suitable for remote callsSTDIO-- standard input/output streams, suitable for local integration
Data source: Hotlist and RSS queries read local
output/ archives (news/, rss/, search/). When a DeepSeek API key is configured, live_web_search and DeepSeek Fetch can also retrieve live web results and full article bodies on demand.Configuration files
TrendRadar's behavior is controlled by the following configuration files, each responsible for a different aspect of the settings:
Configuration priority
When deploying with Docker, environment variables (the values in the
.env file) take priority over the configuration in config.yaml. We recommend keeping secrets (API Key, Webhook URL, etc.) in environment variables and keeping business-logic configuration in config.yaml.Storage architecture
TrendRadar supports two storage methods and chooses automatically based on the deployment environment:
Local storage
Uses SQLite databases stored in the
output/ directory. Suitable for Docker and local deployment scenarios. The data files include the news database (news/), the RSS database (rss/), the web search database (search/), HTML reports, and run logs.Remote storage
Supports S3-compatible cloud storage services (such as Cloudflare R2, Alibaba Cloud OSS, Tencent Cloud COS, etc.). Mainly used for GitHub Actions deployments, because Actions does not keep local files between runs and needs remote storage to persist data.
Module structure
The project's main directories and their corresponding functional modules: