Page updated:

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:
1
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.
2
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).
3
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 analysis

MCP 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 calls
  • STDIO -- 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:
FileRoleEdit frequency
config/config.yamlCore system configuration: push modes, platform selection, AI settings, notification channels, storage schemeLow
config/frequency_words.txtKeyword definitions: groups, filtering rules, regex matchingHigh
config/search_queries.txtWeb search tasks: topic list, domain filters, and global exclusionsMedium
config/timeline.yamlScheduling and timing control: collection, web search, analysis, and push schedule per slotLow
config/ai_analysis_prompt.txtPersona and output-format template for AI analysisMedium
config/ai_translation_prompt.txtPrompt template for AI translationLow
config/ai_interests.txtInterest description for AI smart filteringMedium
docker/.envSecrets and Docker-specific configuration (API Key, Webhook URL, etc.)Low

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:
DirectoryDescription
trendradar/Main program package: data collection, keyword filtering, scoring and ranking, report generation, notification push, storage management
mcp_server/MCP analysis service: an AI chat-based analysis tool built on the Model Context Protocol
config/Configuration directory: system config, keywords, prompts, scheduling plans
docker/Docker deployment files: Compose orchestration file and environment variable configuration
output/Output directory: generated databases, HTML reports, log files