youpaishidifu b8208d6b00 fix: 物理重启时清空数据库历史,彻底清除残留数据
问题:物理重启后,_force_clear_all_residual_data() 清空了内存,
但 _load_replied_texts_from_db() 会从数据库重新加载历史回复,
导致 bot 仍能"凭空看见"已回复的消息。

修复:
- _force_clear_all_residual_data() 增加 clear_db 参数
- full_restart=True 时清空 message_history 和 keyword_scores 表
- full_restart=False 时仅清内存(急停恢复场景)

效果:
- 物理重启(python main.py):清空数据库 + 内存,彻底清除残留
- 急停恢复(双击ESC):仅清内存,保留数据库历史记录
2026-08-19 18:22:52 +08:00
@
2026-08-03 10:12:07 +08:00

消息问答助手 (Message Bot)

Windows 桌面工具,监控微信/QQ 新消息 → 在本地知识库中搜索答案。

功能

  • 消息监控:通过 Windows UI Automation 监听微信/QQ 聊天新消息
  • 本地知识库:支持 Markdown (.md) / 文本 (.txt) 文件,自动建索引
  • 智能问答:jieba 分词 + TF-IDF 余弦相似度搜索
  • GUI 控制:开关、知识库路径、平台选择、轮询间隔

快速开始

# 1. 安装依赖
pip install -r requirements.txt

# 2. 准备知识库
#    在某个文件夹放 .md / .txt 文件

# 3. 启动
python main.py

在 GUI 中选择知识库文件夹 → 开启监控 → 微信/QQ 收到新消息时自动搜索并展示答案。

技术栈

  • customtkinter — 现代化桌面 GUI
  • uiautomation — Windows UI 自动化(消息读取)
  • jieba — 中文分词
  • scikit-learn — TF-IDF 向量化 + 余弦相似度
S
Description
No description provided
Readme
75 MiB
Languages
Python 99%
Batchfile 0.6%
PowerShell 0.4%