Read WeChat chat history from local DuckDB and generate a structured today's report Markdown file, including:
- Data overview (total messages, active chats, time distribution)
- To-do items: Categorized by priority, summarizing and extracting work that needs follow-up
- Fun gossip: Organized into complete stories, rather than fragmented messages
- End with a humorous summary
Step 1: Extract raw data
Run the script to get the day's chat data:
python3 scripts/extract_data.py [--date YYYY-MM-DD] [--db PATH]
The script will output:
- Data statistics (message count, activity level, time distribution)
- Complete work group conversations (for analyzing to-dos)
- Non-work group conversations (for extracting fun stories)
Step 2: Summarize and extract (done by AI)
Based on the raw data, analyze and summarize:
To-do item extraction rules
-
Identify to-do sources:
- Messages where @淇奥 is mentioned
- Conversations containing questions/faults/requests
- Items that need confirmation/follow-up/feedback
-
Categorize by priority:
- 🔴 Needs immediate handling: things to do today, things already promised
- 🟡 Follow up this week: those with clear time nodes
- 🟢 Resolved/Noted: completed or only need to be aware of
-
Format requirements:
1. **事项标题** - 来源:群名/联系人 + 时间 - 具体内容描述 - 状态:当前进展
Fun gossip extraction rules
-
Identify interesting content:
- Topics hotly discussed by group members (multiple people participating in discussion)
- Contains gossip/tea/comedic keywords
- Conversations with a complete storyline
-
Organize into stories:
- Give each story a title + emoji
- Summarize the event process, retain brilliant original quotes
- Highlight the punchlines/roast points
-
Format requirements:
### 🍉 故事标题 故事概括描述,**加粗关键信息**,保留群友精彩原话用引用格式。
Today's summary
End with a humorous sentence, combining the day's to-dos and fun stories, for example:
33 work groups battling online, the Git folder still hasn't been created, but the most important thing is—the red packet for playing Jianwang 3 cannot be claimed.
Step 3: Generate the report
Organize the analysis results into a complete Markdown report and save it to the specified directory.
Report template# 微信日报 (YYYY-MM-DD 周X)
## 一、数据概览
| 指标 | 数值 |
|------|------|
| **消息总数** | X 条 |
| **活跃聊天** | X 个 |
| **活跃人数** | X 人 |
| **峰值时段** | XX:00 (X条) |
## 二、聊天活跃度 TOP 10
(表格)
## 三、消息类型分布
(列表)
## 四、待办事项
### 🔴 需立即处理
### 🟡 本周跟进
### 🟢 已解决/知悉
## 五、趣事吃瓜
### 🍉 故事1
### 📱 故事2
...
## 六、活跃发送者 TOP 10
(表格)
## 七、消息时间分布
(柱状图)
## 今日总结
> 幽默收尾语
---
*报告生成时间: YYYY-MM-DD HH:MM:SS*
Guardrails
- Read-only operations, do not modify the database
- To-do items are extracted only from work-related chats
- Fun gossip does not include sensitive/private content
- The report is output to the current directory by default
scripts/extract_data.py: Data extraction scriptscripts/generate_report.py: Basic report generation script (statistics part)
# 1. 提取今日数据
python3 scripts/extract_data.py
# 2. AI 根据输出概括提炼,生成最终报告
# 或者直接让 AI 生成(推荐)
# "帮我生成今日微信报告"