How zhu-tingshuai/personal_wxwork_zts works
This is a WeCom one-to-one auto-reply desktop application driven by screenshot RPA, OCR, local vector retrieval, and an LLM. Its primary workflow scans the visible client for unread conversations, identifies and extracts customer messages, applies deduplication and quality gates, then automatically sends, requests human confirmation, or escalates. A separate knowledge-ingestion workflow turns chat exports and videos into searchable Qdrant data. The graph includes README-documented features whose source was not sampled; those links cite the README rather than implying their implementation was inspected.
Main entry points: main.py Scan coordinator · responder.py Reply orchestration · _message_detector.py Message detector · run_pipeline.py Import coordinator
Components 28
App orchestration
- Scan coordinator
main.py - Runtime config
config/manager.py
WeCom capture
- Window scanner
wxbot/scanner.py - Message detector
wxbot/detector/_message_detector.py - Unread detection
wxbot/detector/red_dot.py - Bubble analysis
wxbot/detector/bubble.py - Name region
wxbot/detector/name_region.py - OCR extraction
wxbot/detector/ocr_engine.py
RAG and dispatch
- Reply orchestration
rag/responder.py - Query embedding
rag/embed_query.py - Vector retrieval
rag/retriever.py - Knowledge vectors
- Reply generation
rag/generator.py - DeepSeek service
- Quality gate
rag/guard.py - Human fallback
rag/human_fallback.py - Message sender
wxbot/sender.py
Knowledge ingestion
- Import coordinator
pipeline/run_pipeline.py - Chat importer
pipeline/chat_importer.py - Video transcription
pipeline/video_transcribe.py - Text chunking
pipeline/chunker.py - Vector ingestion
pipeline/embedder.py
Operator tools
- Control window
gui/main_window.py - Human notification
notify/fallback_ui.py - Debug visualizer
debug/visualizer.py - RAG evaluation
eval
Other components
- Operator
- WeCom desktop
Connections 30
- Operator → Scan coordinator: starts and controls
README.md - Scan coordinator → Runtime config: loads settings
main.py - Scan coordinator → Window scanner: schedules scans
main.py - Window scanner → WeCom desktop: captures and clicks
README.md - Scan coordinator → Message detector: processes screenshots
README.md - Message detector → Unread detection: checks unread marks
wxbot/detector/_message_detector.py - Message detector → Bubble analysis: analyzes bubbles
wxbot/detector/_message_detector.py - Message detector → Name region: detects names
wxbot/detector/_message_detector.py - Message detector → OCR extraction: extracts text
wxbot/detector/_message_detector.py - Scan coordinator → Reply orchestration: submits messages
main.py - Reply orchestration → Query embedding: embeds query
rag/responder.py - Reply orchestration → Vector retrieval: searches knowledge
rag/responder.py - Vector retrieval → Knowledge vectors: queries vectors
README.md - Reply orchestration → Reply generation: requests reply
rag/responder.py - Reply generation → DeepSeek service: calls chat API
rag/generator.py - Reply orchestration → Quality gate: checks response
README.md - Reply orchestration → Human fallback: escalates cases
rag/responder.py - Reply orchestration → Message sender: routes approved send
rag/responder.py - Message sender → WeCom desktop: sends reply
README.md - Scan coordinator → Control window: updates controls
main.py - Scan coordinator → Human notification: notifies escalation
- Scan coordinator → Debug visualizer: records scan results
main.py - Operator → Control window: reviews pending replies
README.md - Import coordinator → Chat importer: parses chat exports
pipeline/run_pipeline.py - Import coordinator → Video transcription: transcribes videos
pipeline/run_pipeline.py - Import coordinator → Text chunking: splits source text
pipeline/run_pipeline.py - Import coordinator → Vector ingestion: stores chunks
pipeline/run_pipeline.py - Vector ingestion → Knowledge vectors: writes vectors
pipeline/embedder.py - RAG evaluation → Vector retrieval: evaluates retrieval
eval/run.py - RAG evaluation → Reply generation: evaluates generation
eval/run.py