ai-analyzer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAI健康分析器
AI Health Analyzer
基于AI技术的综合健康分析系统,提供智能健康洞察、风险预测和个性化建议。
An AI-powered comprehensive health analysis system that provides intelligent health insights, risk prediction, and personalized recommendations.
核心功能
Core Features
1. 智能健康分析
1. Intelligent Health Analysis
- 多维度数据整合: 整合基础指标、生活方式、心理健康、医疗历史等4类数据源
- 异常模式识别: 使用CUSUM、Z-score等算法检测异常值和变化点
- 相关性分析: 计算不同健康指标之间的相关性(皮尔逊、斯皮尔曼)
- 趋势预测: 基于历史数据进行趋势分析和预测
- Multi-dimensional data integration: Integrates 4 types of data sources including basic indicators, lifestyle, mental health, and medical history
- Abnormal pattern recognition: Detects outliers and change points using algorithms like CUSUM and Z-score
- Correlation analysis: Calculates correlations between different health indicators (Pearson, Spearman)
- Trend prediction: Conducts trend analysis and prediction based on historical data
2. 健康风险预测
2. Health Risk Prediction
- 高血压风险: 基于Framingham风险评分模型
- 糖尿病风险: 基于ADA糖尿病风险评分标准
- 心血管疾病风险: 基于ACC/AHA ASCVD指南
- 营养缺乏风险: 基于RDA达成率和饮食模式分析
- 睡眠障碍风险: 基于PSQI和睡眠模式分析
- Hypertension risk: Based on the Framingham Risk Score model
- Diabetes risk: Based on ADA Diabetes Risk Criteria
- Cardiovascular disease risk: Based on ACC/AHA ASCVD guidelines
- Nutritional deficiency risk: Based on RDA achievement rate and dietary pattern analysis
- Sleep disorder risk: Based on PSQI and sleep pattern analysis
3. 个性化建议引擎
3. Personalized Recommendation Engine
- 基础个性化: 基于年龄、性别、BMI、活动水平等静态档案
- 建议分级: Level 1(一般性)、Level 2(参考性)、Level 3(医疗建议)
- 循证依据: 基于医学指南和循证医学证据
- 可操作性: 提供具体、可行的改进建议
- Basic personalization: Based on static profiles such as age, gender, BMI, and activity level
- Recommendation grading: Level 1 (general), Level 2 (reference), Level 3 (medical advice)
- Evidence-based: Based on medical guidelines and evidence-based medicine
- Operability: Provides specific, feasible improvement suggestions
4. 自然语言交互
4. Natural Language Interaction
- 智能问答: 支持健康数据查询、趋势分析、相关性查询等
- 上下文理解: 维护对话历史,支持多轮对话
- 意图识别: 识别用户查询意图,提供精准回复
- Intelligent Q&A: Supports health data queries, trend analysis, correlation queries, etc.
- Context understanding: Maintains conversation history and supports multi-turn dialogue
- Intent recognition: Identifies user query intent and provides precise responses
5. AI健康报告生成
5. AI Health Report Generation
- 综合报告: 包含所有维度健康数据、AI洞察、风险评估
- 快速摘要: 关键指标概览、异常警示、主要建议
- 风险评估报告: 各类疾病风险、风险因素分析、预防措施
- 趋势分析报告: 多维度趋势、变化点识别、预测分析
- HTML交互式报告: ECharts图表、Tailwind CSS样式
- Comprehensive report: Includes multi-dimensional health data, AI insights, and risk assessment
- Quick summary: Overview of key indicators, anomaly alerts, and main recommendations
- Risk assessment report: Various disease risks, risk factor analysis, and preventive measures
- Trend analysis report: Multi-dimensional trends, change point identification, and predictive analysis
- Interactive HTML report: ECharts charts, Tailwind CSS styling
使用说明
Usage Instructions
触发条件
Trigger Conditions
当用户提到以下场景时,使用此技能:
通用询问:
- ✅ "AI分析我的健康状况"
- ✅ "我的健康有什么风险?"
- ✅ "生成AI健康报告"
- ✅ "AI分析所有数据"
风险预测:
- ✅ "预测我的高血压风险"
- ✅ "我有糖尿病风险吗?"
- ✅ "评估我的心血管风险"
- ✅ "AI预测健康风险"
智能问答:
- ✅ "我的睡眠怎么样?"
- ✅ "运动对我的健康有什么影响?"
- ✅ "我应该如何改善健康状况?"
- ✅ "AI健康助手问答"
报告生成:
- ✅ "生成AI健康报告"
- ✅ "创建综合分析报告"
- ✅ "AI风险评估报告"
Use this skill when the user mentions the following scenarios:
General Inquiries:
- ✅ "AI analyze my health status"
- ✅ "What health risks do I have?"
- ✅ "Generate AI health report"
- ✅ "AI analyze all data"
Risk Prediction:
- ✅ "Predict my hypertension risk"
- ✅ "Am I at risk of diabetes?"
- ✅ "Assess my cardiovascular risk"
- ✅ "AI predict health risks"
Intelligent Q&A:
- ✅ "How is my sleep?"
- ✅ "What impact does exercise have on my health?"
- ✅ "How should I improve my health?"
- ✅ "AI health assistant Q&A"
Report Generation:
- ✅ "Generate AI health report"
- ✅ "Create comprehensive analysis report"
- ✅ "AI risk assessment report"
执行步骤
Execution Steps
步骤 1: 读取AI配置
Step 1: Read AI Configuration
javascript
const aiConfig = readFile('data/ai-config.json');
const aiHistory = readFile('data/ai-history.json');检查AI功能是否启用,验证数据源配置。
javascript
const aiConfig = readFile('data/ai-config.json');
const aiHistory = readFile('data/ai-history.json');Check if AI functions are enabled and verify data source configurations.
步骤 2: 读取用户档案
Step 2: Read User Profile
javascript
const profile = readFile('data/profile.json');获取基础信息:年龄、性别、身高、体重、BMI等。
javascript
const profile = readFile('data/profile.json');Obtain basic information: age, gender, height, weight, BMI, etc.
步骤 3: 读取健康数据
Step 3: Read Health Data
根据配置的数据源读取相关数据:
javascript
// 基础健康指标
const indexData = readFile('data/index.json');
// 生活方式数据
const fitnessData = readFile('data-example/fitness-tracker.json');
const sleepData = readFile('data-example/sleep-tracker.json');
const nutritionData = readFile('data-example/nutrition-tracker.json');
// 心理健康数据
const mentalHealthData = readFile('data-example/mental-health-tracker.json');
// 医疗历史
const medications = exists('data/medications.json') ? readFile('data/medications.json') : null;
const allergies = exists('data/allergies.json') ? readFile('data/allergies.json') : null;Read relevant data according to configured data sources:
javascript
// Basic health indicators
const indexData = readFile('data/index.json');
// Lifestyle data
const fitnessData = readFile('data-example/fitness-tracker.json');
const sleepData = readFile('data-example/sleep-tracker.json');
const nutritionData = readFile('data-example/nutrition-tracker.json');
// Mental health data
const mentalHealthData = readFile('data-example/mental-health-tracker.json');
// Medical history
const medications = exists('data/medications.json') ? readFile('data/medications.json') : null;
const allergies = exists('data/allergies.json') ? readFile('data/allergies.json') : null;步骤 4: 数据整合和预处理
Step 4: Data Integration and Preprocessing
整合所有数据源,进行数据清洗、时间对齐和缺失值处理。
Integrate all data sources, perform data cleaning, time alignment, and missing value handling.
步骤 5: 多维度分析
Step 5: Multi-dimensional Analysis
相关性分析: 计算睡眠↔情绪、运动↔体重、营养↔生化指标等关联
趋势分析: 使用线性回归、移动平均等方法识别趋势方向
异常检测: 使用CUSUM、Z-score算法检测异常值和变化点
Correlation analysis: Calculate correlations such as sleep ↔ mood, exercise ↔ weight, nutrition ↔ biochemical indicators
Trend analysis: Use methods like linear regression and moving average to identify trend directions
Anomaly detection: Detect outliers and change points using CUSUM and Z-score algorithms
步骤 6: 风险预测
Step 6: Risk Prediction
基于Framingham、ADA、ACC/AHA等标准进行风险预测:
- 高血压风险(10年概率)
- 糖尿病风险(10年概率)
- 心血管疾病风险(10年概率)
- 营养缺乏风险
- 睡眠障碍风险
Perform risk prediction based on standards such as Framingham, ADA, and ACC/AHA:
- Hypertension risk (10-year probability)
- Diabetes risk (10-year probability)
- Cardiovascular disease risk (10-year probability)
- Nutritional deficiency risk
- Sleep disorder risk
步骤 7: 生成个性化建议
Step 7: Generate Personalized Recommendations
根据分析结果生成三级建议:
- Level 1: 一般性建议(基于标准指南)
- Level 2: 参考性建议(基于个人数据)
- Level 3: 医疗建议(需医生确认,包含免责声明)
Generate three levels of recommendations based on analysis results:
- Level 1: General recommendations (based on standard guidelines)
- Level 2: Reference recommendations (based on personal data)
- Level 3: Medical advice (requires doctor confirmation, includes disclaimer)
步骤 8: 生成分析报告
Step 8: Generate Analysis Report
文本报告: 包含总体评估、风险预测、关键趋势、相关性发现、个性化建议
HTML报告: 调用 生成包含ECharts图表的交互式报告
scripts/generate_ai_report.pyText report: Includes overall assessment, risk prediction, key trends, correlation findings, personalized recommendations
HTML report: Call to generate interactive report with ECharts charts
scripts/generate_ai_report.py步骤 9: 更新AI历史记录
Step 9: Update AI History
记录分析结果到
data/ai-history.jsonRecord analysis results to
data/ai-history.json数据源
Data Sources
| 数据源 | 文件路径 | 数据内容 |
|---|---|---|
| 用户档案 | | 年龄、性别、身高、体重、BMI |
| 医疗记录 | | 生化指标、影像检查 |
| 运动追踪 | | 运动类型、时长、强度、MET值 |
| 睡眠追踪 | | 睡眠时长、质量、PSQI评分 |
| 营养追踪 | | 饮食记录、营养素摄入、RDA达成率 |
| 心理健康 | | PHQ-9、GAD-7评分 |
| 用药记录 | | 药物名称、剂量、用法、依从性 |
| 过敏史 | | 过敏原、严重程度 |
| Data Source | File Path | Data Content |
|---|---|---|
| User Profile | | Age, gender, height, weight, BMI |
| Medical Records | | Biochemical indicators, imaging examinations |
| Fitness Tracker | | Exercise type, duration, intensity, MET value |
| Sleep Tracker | | Sleep duration, quality, PSQI score |
| Nutrition Tracker | | Diet records, nutrient intake, RDA achievement rate |
| Mental Health | | PHQ-9, GAD-7 scores |
| Medication Records | | Drug name, dosage, usage, compliance |
| Allergy History | | Allergens, severity |
算法说明
Algorithm Explanation
相关性分析
Correlation Analysis
- 皮尔逊相关系数: 连续变量(如睡眠时长与情绪评分)
- 斯皮尔曼相关系数: 有序变量(如症状严重程度)
- Pearson correlation coefficient: For continuous variables (e.g., sleep duration vs. mood score)
- Spearman correlation coefficient: For ordinal variables (e.g., symptom severity)
异常检测
Anomaly Detection
- CUSUM算法: 时间序列变化点检测
- Z-score方法: 统计异常值检测(|z| > 2)
- IQR方法: 四分位数异常值检测
- CUSUM algorithm: Time series change point detection
- Z-score method: Statistical outlier detection (|z| > 2)
- IQR method: Interquartile range outlier detection
风险预测
Risk Prediction
- Framingham风险评分: 高血压、心血管疾病风险
- ADA风险评分: 2型糖尿病风险
- ASCVD计算器: 动脉粥样硬化心血管病风险
- Framingham Risk Score: Hypertension, cardiovascular disease risk
- ADA Risk Score: Type 2 diabetes risk
- ASCVD Calculator: Atherosclerotic cardiovascular disease risk
安全与合规
Safety and Compliance
必须遵循
Must Follow
- ❌ 不给出医疗诊断
- ❌ 不给出具体用药剂量建议
- ❌ 不判断生死预后
- ❌ 不替代医生建议
- ✅ 所有分析必须标注"仅供参考"
- ✅ Level 3建议必须包含免责声明
- ✅ 高风险预测必须建议咨询医生
- ❌ Do not provide medical diagnosis
- ❌ Do not provide specific medication dosage recommendations
- ❌ Do not judge life-or-death prognosis
- ❌ Do not replace doctor's advice
- ✅ All analysis must be labeled "For reference only"
- ✅ Level 3 recommendations must include a disclaimer
- ✅ High-risk predictions must advise consulting a doctor
隐私保护
Privacy Protection
- ✅ 所有数据保持本地
- ✅ 无外部API调用
- ✅ HTML报告独立运行
- ✅ All data remains local
- ✅ No external API calls
- ✅ HTML report runs independently
相关命令
Related Commands
- - AI综合分析
/ai analyze - - 健康风险预测
/ai predict [risk_type] - - 自然语言问答
/ai chat [query] - - 生成AI健康报告
/ai report generate [type] - - 查看AI功能状态
/ai status
- - AI comprehensive analysis
/ai analyze - - Health risk prediction
/ai predict [risk_type] - - Natural language Q&A
/ai chat [query] - - Generate AI health report
/ai report generate [type] - - Check AI function status
/ai status
技术实现
Technical Implementation
工具限制
Tool Restrictions
此Skill仅使用以下工具:
- Read: 读取JSON数据文件
- Grep: 搜索特定模式
- Glob: 按模式查找数据文件
- Write: 生成HTML报告和更新历史记录
This Skill only uses the following tools:
- Read: Read JSON data files
- Grep: Search for specific patterns
- Glob: Find data files by pattern
- Write: Generate HTML reports and update history records
性能优化
Performance Optimization
- 增量读取:仅读取指定时间范围的数据文件
- 数据缓存:避免重复读取同一文件
- 延迟计算:按需生成图表数据
- Incremental reading: Only read data files within the specified time range
- Data caching: Avoid repeated reading of the same file
- Lazy calculation: Generate chart data on demand