A production-ready multilingual health reporting system with dual-engine architecture.
Transform local Markdown health memories into polished Daily, Weekly, and Monthly PDF reports with condition-aware scoring, specialty charts, medical planning, and optional webhook delivery.
Health-Mate sits between a simple habit tracker and a clinical self-management dashboard.
- ๐ง Condition-Aware: Gallstones, hypertension, diabetes, fat loss, and mixed-condition management supported out of the box
- ๐ Report-First: Generates polished Daily, Weekly, and Monthly PDFs with charts, insights, and actionable guidance
- ๐ Local-First Privacy: Parsing, scoring, fallback reasoning, and PDF rendering stay local by default
- ๐งฉ Expandable: Add blood pressure, glucose, body fat, biochemistry, medication, or custom numeric monitoring via
user_config.json - ๐ Multilingual Support: Full support for Chinese, English, and Japanese (
zh-CN,en-US,ja-JP) with automatic font fallback and locale-aware medical typesetting
Answers: "How did today go, and what should I change tomorrow?"
Core Modules:
- ๐ Dynamic Nutrition Ring Chart: Macro adherence visualization (protein, fat, carbs, fiber)
- ๐ Intake Stacked Bar: Meals, hydration, and exercise displayed in layered timeline
โ ๏ธ Risk Alerts: Condition-specific warnings (e.g., fat too low for gallstones, sodium too high for hypertension)- ๐ Next-Day Action Plan: Concrete, executable adjustments for tomorrow (specific foods, water targets, movement goals)
When to Use: Daily reflection, immediate behavior correction, maintaining momentum
Answers: "Which behaviors stabilized, and which problems keep repeating?"
Core Modules:
- ๐ฏ Weekly Metrics Radar: Multi-dimension overview (calories, macros, hydration, steps, sleep if tracked)
- ๐ฅ Habit & Exercise Heatmap: GitHub-style contribution graph for
balanced/fat_lossmodes - ๐ Dual-Axis Trend Charts: Weight + calorie balance, steps + hydration, symptom frequency + trigger exposure
- ๐ฅ Disease Mode: Symptom-medication correlation heatmap for chronic conditions
- ๐ช Fitness Mode: Four-week habit progression bars, energy balance waterfall chart
- ๐ Strengths & Gaps: What improved, what needs attention next week
When to Use: Weekly review, identifying patterns, adjusting strategy before monthly checkpoint
Answers: "Is my current strategy effective? Do I need offline follow-up or escalated intervention?"
Core Modules:
- ๐ฏ Macro Adherence Radar: 30-day nutritional pattern overview
- ๐ฅ Activity Heatmap: Full-month GitHub-style graph (lifestyle mode) or symptom-medication heatmap (disease mode)
- ๐ 30-Day Weight & BMR Trend: Smoothed curve with annotations for significant events
- ๐ฅ Specialty Charts: Condition-specific deep-dive visualizations
- ๐ง AI Monthly Review: LLM-generated synthesis of trends, risks, and recommendations
- ๐ฅ Medical Planning Section (Disease Mode Only):
- Hospital-first recommendations (top-tier tertiary > tertiary > regional center)
- Department and doctor matching with specialty alignment
- Follow-up reminders based on condition guidelines
- ๐ Lifestyle Intervention List (Fitness Mode Only):
- Next-month macro and training adjustments
- Body composition goals (LBM vs fat mass)
- Habit stacking recommendations
When to Use: Monthly strategic review, medical follow-up planning, major course corrections
Health-Mate intelligently switches its underlying report engine based on the population_branch setting in user_config.json.
Activated When: gallstones, hypertension, diabetes, or other chronic conditions
Report Characteristics:
- ๐ฉบ Pathophysiology-Aligned Charts: Fat intake vs symptom frequency (gallstones), BP boxplot (hypertension), glucose trend (diabetes)
- ๐ Medication Adherence Analysis: Dose timing, missed doses, correlation with symptoms
โ ๏ธ High-Risk Food Trigger Identification: Foods correlated with symptom flare-ups- ๐ฅ Hospital & Doctor Recommendations (Monthly Only):
- LLM-generated structured suggestions (hospital โ department โ doctor)
- Tavily retrieval fallback for evidence-based local candidates
- Preference for public top-tier tertiary hospitals and university-affiliated centers
- Real doctor names and titles when evidence is sufficient
Example Output (Gallstones Monthly Report):
- Fat intake vs symptom frequency dual-axis chart
- Fat/carb intake dispersion boxplot
- Symptom composition donut chart
- Hospital recommendation: "Sichuan Provincial People's Hospital โ Hepatobiliary Surgery โ Dr. Zhou Yongbi (Chief Physician)"
Activated When: balanced, fat_loss, or general health optimization
Report Characteristics:
- ๐ De-Medicalized Visualization: No symptom tracking, no hospital recommendations
- ๐ฅ Four-Week Habit Progression: Stacked bar showing consistency across key behaviors
- โ๏ธ Energy Balance Waterfall: Calorie intake vs expenditure vs deficit/surplus
- ๐ช Body Composition Deep-Dive: LBM (Lean Body Mass) vs fat mass trend, body fat percentage smoothing
- ๐ฏ Next-Month Macro & Training Plan:
- Protein target adjustment for muscle preservation
- Carb timing around workouts
- Training volume progression (sets, reps, intensity)
Example Output (Fat Loss Monthly Report):
- 30-day weight trend with smoothed curve
- Body fat percentage trend
- Energy balance waterfall chart
- Four-week habit progression (steps, workouts, protein intake, sleep)
- Next-month intervention: "Increase protein to 2.0g/kg, add 2 resistance sessions, maintain 500kcal deficit"
| Layer | Technology | Purpose |
|---|---|---|
| PDF Rendering | ReportLab 4.0+ | Professional-grade PDF generation with custom styling, multi-language font support, and precise layout control |
| Data Visualization | Matplotlib 3.0+ | Statistical charts (radar, heatmap, boxplot, dual-axis trends) with condition-specific styling |
| LLM Integration | OpenClaw Local Agent + Tavily API | Hybrid reasoning: local LLM for AI commentary and hospital recommendations, Tavily for evidence-based web retrieval fallback |
| Scheduling | Cron + OpenClaw HEARTBEAT | Automated daily/weekly/monthly report generation with optional DingTalk/Feishu/Telegram push delivery |
git clone https://github.com/tankeito/Health-Mate.git health-mate
cd health-mate
pip install -r requirements.txtClawHub manual folder upload may omit config/.env.example. Open config/user_config.example.json and review the top-level env block as an upload-safe reference.
The setup wizard creates a commented project-local config/.env template when the file does not exist.
Direct Python entry points also auto-load project-local config/.env when present, so manual script runs stay aligned with the shell runners.
# ========== Cron Environment Variables (Required for scheduled tasks) ==========
NVM_DIR="/root/.nvm"
CRON_PATH="/root/.nvm/versions/node/v22.22.0/bin:/root/.local/bin:/root/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/bin:/usr/bin:/bin:/root/.npm-global/bin"
# ========== Required Configuration ==========
MEMORY_DIR="/root/.openclaw/workspace/memory"
# ========== Optional Configuration ==========
OPENCLAW_BIN="/root/.nvm/versions/node/v22.22.0/bin/openclaw" # Recommended for cron
LOG_FILE="/root/.openclaw/logs/health_report_pro.log"
# Messaging (Optional)
DINGTALK_WEBHOOK="https://..."
FEISHU_WEBHOOK="https://..."
TELEGRAM_BOT_TOKEN="..."
TELEGRAM_CHAT_ID="..."
# AI Features (Optional)
TAVILY_API_KEY="tvly-..."
# PDF Report (Optional)
REPORT_WEB_DIR="/var/www/html/reports"
REPORT_BASE_URL="https://example.com/reports"
# Font Download (Default: false)
ALLOW_RUNTIME_FONT_DOWNLOAD="false"python scripts/init_config.pyThe wizard writes all persistent settings into config/user_config.json:
- Profile basics
- Active conditions and primary condition
- Scoring modules and weights
- Medication settings
- Residence (used by monthly medical planning)
- Custom monitoring modules
report_preferences.population_branch(lifestyle vs disease routing)- Report and AI-generation preferences
# Daily Report
python scripts/daily_report_pro.py /path/to/memory/2026-03-20.md 2026-03-20
# Weekly Report
python scripts/weekly_report_pro.py 2026-03-20
# Monthly Report
python scripts/monthly_report_pro.py 2026-03-20scripts/daily_health_report_pro.sh
scripts/weekly_health_report_pro.sh
scripts/monthly_health_report_pro.shCron Environment Note: If your scheduled shell does not inherit the interactive Node/NVM PATH, set OPENCLAW_BIN in config/.env. The daily runner and Python controller both use it as the first-choice resolver for local LLM execution.
If OPENCLAW_BIN is not set, the Python runner tries common install locations:
/root/.nvm/versions/node/*/bin/openclaw/usr/local/bin/openclaw/usr/bin/openclaw- Windows standard Node.js path
python scripts/export_memory_en.pyUse this when you want:
- An English mirror of local memory files
- An English rendering path when Chinese fonts are unavailable
- Bilingual regression checks for report output
Main long-term profile file storing:
- User profile
- Active conditions and primary condition
- Enabled score modules and weights
- Medication settings
- Residence metadata
- Custom monitoring modules
- Report preferences
- AI-generation preferences
Important: report_preferences.population_branch
- Supported values:
lifestyle/disease - Example config starts with
lifestyle - Setup wizard auto-suggests
lifestyleforbalanced/fat_loss, anddiseasefor disease-management goals
| Variable | Required | Purpose |
|---|---|---|
MEMORY_DIR |
Yes | Points to the health-memory directory |
TAVILY_API_KEY |
No | Enables Tavily retrieval fallback |
DINGTALK_WEBHOOK |
No | Pushes text summary and PDF link to DingTalk |
FEISHU_WEBHOOK |
No | Pushes text summary and PDF link to Feishu |
TELEGRAM_BOT_TOKEN / TELEGRAM_CHAT_ID |
No | Pushes text summary and PDF link to Telegram |
REPORT_WEB_DIR |
No | Copies generated PDFs to a web directory |
REPORT_BASE_URL |
No | Builds public PDF URLs for push messages |
ALLOW_RUNTIME_FONT_DOWNLOAD |
No | Allows runtime font download (default: false) |
When an assistant writes into MEMORY_DIR, it must behave like a strict recorder.
- โ No commentary
- โ No encouragement
- โ No summaries
- โ No emoji
- โ No chat filler
- โ
Meals, hydration, medication, and exercise events must use level-3 headings with time markers (e.g.,
### Breakfast (around 08:50)) - โ Hydration blocks must stay minimal and stable (only intake + cumulative)
- โ
Daily step totals must stay inside a dedicated level-2 section (
## Today Steps) - โ Custom monitoring modules must keep stable level-2 section names
- โ Avoid mixing languages inside one data block
# 2026-03-20 Health Log
## Weight Record
- Morning fasting: 64.4kg
## Hydration
### Morning (around 08:45)
- Water intake: 300ml
- Cumulative: 300ml/2000ml
## Meals
### Breakfast (around 08:50)
- Oatmeal 50g -> approx. 190kcal
- Skim milk 250ml -> approx. 87kcal
## Exercise
### Afternoon Cycling (around 17:10)
- Distance: 10.2km
- Duration: 42min
- Burn: approx. 290kcal
## Today Steps
- Total steps: 8200 steps## Blood Pressure
### Morning (around 08:00)
- Blood Pressure: 128/82 mmHg
- Heart Rate: 72 bpm
## Glucose Record
### After Breakfast (around 10:10)
- Glucose: 7.1 mmol/L
- Timing: 2h after breakfast
## Body Composition
- Weight: 64.4kg
- Body Fat: 18.6%
## Biochemistry
- ALT: 34 U/L
- AST: 28 U/LAssessmentStatusSummary- Motivational filler
- Debug logs
- System logs
assets/NotoSansSC-VF.ttf(Chinese)assets/NotoSansJP-VF.ttf(Japanese)
- The renderer switches to an English-safe rendering path
- The PDF adds a rendering notice
- Chinese PDF users: Place
NotoSansSC-VF.ttfintoassets/ - Japanese PDF users: Place
NotoSansJP-VF.ttfintoassets/
Symptoms: Shell runners stop immediately with error
Solution:
- Set
MEMORY_DIRexplicitly inconfig/.envor your runtime environment - For ClawHub manual uploads, copy the
MEMORY_DIRexample fromconfig/user_config.example.jsonโenv
Symptoms: Hospital suggestions lack specific doctor names or feel templated
Solution:
- Make sure residence is configured in
config/user_config.json - Confirm local LLM execution is available (set
OPENCLAW_BINfor cron) - Configure
TAVILY_API_KEYfor retrieval-enhanced fallback - If LLM is unavailable, the city-specific local-rule layer still tries to prefer real hospital + doctor combinations where curated data exists
Symptoms: PDF renders in English despite Chinese/Japanese content
Solution:
- Required CJK font is missing
- Place
assets/NotoSansSC-VF.ttforassets/NotoSansJP-VF.ttflocally and regenerate
Symptoms: Report generated but no DingTalk/Feishu/Telegram message received
Solution:
- Check whether the corresponding webhook variables are configured in
config/.env - Inspect
logs/directory for runtime delivery output - Verify webhook URLs are valid and not expired
Health-Mate is built around explicit privacy boundaries.
- ๐ Markdown Parsing: All health data extracted from local
MEMORY_DIRfiles - ๐ Scoring & Charts: Condition-aware scoring, statistical calculations, chart rendering
- ๐ PDF Generation: ReportLab renders PDFs entirely offline
- LLM Commentary: Local
openclaw agent --localfor AI insights (no cloud API required) - LLM Output Sanitization: Plugin-registration logs are stripped before AI commentary is embedded into text pushes or PDFs
- ๐ Tavily Retrieval: Only when
TAVILY_API_KEYis configured (for hospital recommendations or fallback guidance) - ๐ค Webhook Delivery: Only when DingTalk/Feishu/Telegram credentials are set
- โฌ๏ธ Runtime Font Download: Disabled by default; set
ALLOW_RUNTIME_FONT_DOWNLOAD=trueonly if you explicitly allow it
# Use virtual environment or container isolation
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Explicitly set MEMORY_DIR to a private directory
export MEMORY_DIR="$HOME/.health-mate/memory"
# Do NOT configure webhook or Tavily unless needed
# Leave TAVILY_API_KEY and WEBHOOK_URLs unset for maximum privacyhealth-mate/
โโโ scripts/
โ โโโ daily_report_pro.py
โ โโโ weekly_report_pro.py
โ โโโ monthly_report_pro.py
โ โโโ daily_pdf_generator.py
โ โโโ weekly_pdf_generator.py
โ โโโ monthly_pdf_generator.py
โ โโโ i18n.py
โ โโโ init_config.py
โ โโโ export_memory_en.py
โ โโโ export_memory_jp.py
โ โโโ daily_health_report_pro.sh
โ โโโ weekly_health_report_pro.sh
โ โโโ monthly_health_report_pro.sh
โโโ config/
โ โโโ user_config.json
โ โโโ user_config.example.json
โ โโโ .env
โ โโโ pdf_style_config.json
โโโ assets/
โ โโโ NotoSansSC-VF.ttf
โ โโโ NotoSansJP-VF.ttf
โโโ logs/
โโโ reports/
โโโ README.md
โโโ README_ZH.md
โโโ README_JP.md
โโโ SKILL.md
โโโ _meta.json
โโโ requirements.txt
- Enhanced PDF visual styling with refined layout and improved readability
- Fixed minor formatting issues in daily, weekly, and monthly report generators
- Optimized symbol rendering for better cross-platform compatibility
- Sanitized local-LLM stdout before AI commentary is embedded into push text or PDFs
- Added a second daily-PDF commentary filter as a defensive fallback
- Aligned direct Python execution with shell runners by auto-loading project-local config/.env
- GitHub Issues: https://github.com/tankeito/Health-Mate/issues
- Repository: https://github.com/tankeito/Health-Mate
- Email: tqd354@gmail.com
Health-Mate | Local-First Multilingual Health Reporting System
Developed by tankeito | MIT License | 2026