A Python SDK to automate the content workflow: identifying trending articles, crawling content, summarizing with AI, generating matching illustrations, and publishing drafts to WeChat Official Accounts.
- Multimodal Intelligence:
- Vision Analysis: Uses Qwen-VL to "see" and describe images from source articles.
- AI Illustrations: Generates cover images via Qwen (Wanx) or Gemini (Imagen).
- Unified Daily Digest:
- Tech Crunch Style: Aggregates multiple articles into a single, cohesive narrative with smooth transitions.
- AI Title Generation: Creates professional, catchy titles daily.
- Robust Publishing:
- Host-First Images: Automatically downloads original images and uploads them to WeChat to ensure valid hotlinking.
- Deduplication: Global tracking prevents image repetition across the digest.
- Smart Notifications:
- Feishu Webhook: Sends a status card to your Feishu group upon successful push.
graph TD
RSS[RSS Sources] -->|Fetch| Fetcher[Fetcher Service]
Fetcher -->|URLs| DB[(PostgreSQL)]
Fetcher -->|New Articles| Crawler[Firecrawl Scraper]
Crawler -->|Markdown| Analyzer[LLM Analyzer]
Analyzer -->|Topics| Cluster[Topic Clusterer]
subgraph "Multimodal Synthesis"
Cluster -->|Img URLs| Vision[Qwen-VL Vision]
Vision -->|Descriptions| Synthesizer[DeepSeek Unifier]
Cluster -->|Content| Synthesizer
Synthesizer -->|Unified Draft| Formatter[WeChat Formatter]
end
Formatter -->|Assets| Uploader[WeChat Uploader]
Uploader -->|Push| MP[WeChat Official Account]
MP -.->|Callback| Feishu[Feishu Notification]
WeFlow uses the following Priority Logic to load RSS feeds:
- Highest Priority: Environment Variable
RSS_FEEDS. If this is set in.env(and not empty), the system will ONLY use the feeds specified here, ignoring the default list. - Default Fallback: Built-in High-Quality List. If
RSS_FEEDSis not set or empty, the system automatically loads the following feeds:- OpenAI Blog
- BAIR (Berkeley AI Research)
- DeepMind
- Distill
- MIT Technology Review
- Hugging Face Blog
- AI Shift
- Ethics and Society
- The Gradient
- Machine Learning Mastery
- KDnuggets
- Artificial Intelligence News
Configure in .env using commas to separate URLs:
# Override default list, only fetch from these:
RSS_FEEDS=https://tech.meituan.com/feed/,https://www.solidot.org/index.rss,https://feeds.feedburner.com/PythonInsider- Python 3.12+
- uv (recommended)
- PostgreSQL database
-
Clone the repository
git clone <repository_url> cd message-topai
-
Install dependencies
uv sync
If you don't have local PostgreSQL, use Docker:
docker run -d \
--name weflow-db \
-e POSTGRES_USER=weflow \
-e POSTGRES_PASSWORD=weflow \
-e POSTGRES_DB=weflow \
-p 5432:5432 \
postgres:15-
Environment Variables
cp .env.example .env
-
Edit
.env:Get API Keys:
- Firecrawl: firecrawl.dev
- DeepSeek: platform.deepseek.com
- DashScope (Qwen): dashscope.console.aliyun.com
# Core FIRECRAWL_API_KEY=fc_... # Web Crawling DEEPSEEK_API_KEY=sk-... # LLM (Summarization & Unification) # Database (Matches Docker config above) DATABASE_URL=postgresql://weflow:weflow@localhost:5432/weflow # WeChat Official Account WECHAT_APP_ID=wx... WECHAT_APP_SECRET=... WECHAT_AUTHOR="WeFlow Bot" # Multimodal (Vision & Image Gen) # Provider: 'qwen' (recommended) or 'gemini' IMAGE_PROVIDER=qwen DASHSCOPE_API_KEY=sk-... # Qwen-VL & Wanx # Notifications (Optional) FEISHU_WEBHOOK_URL=https://open.feishu.cn/...
Run the daily pipeline:
uv run python src/weflow/main.pyThe system will:
- Fetch articles from Yesterday (T-1 Day).
- Analyze content and describe images using Vision models.
- Synthesize a Unified Daily Digest in Markdown.
- Upload all embedded images to WeChat.
- Push the final draft and notify Feishu.
- Run Tests:
uv run pytest
- Verify Setup:
uv run python tests/verify_setup.py



