VitaVault:面向 AI 智能体的 Apple 健康集成 - Openclaw Skills

作者:互联网

2026-03-30

AI教程

什么是 VitaVault?

VitaVault 是针对 Openclaw Skills 生态系统的专业集成工具,可在 Apple 健康生态系统与您的本地 AI 智能体之间建立直接、安全的管道。与依赖中心化云存储的传统健康应用不同,VitaVault 确保敏感的生物识别数据直接从您的 iPhone 流向智能体的宿主环境。这允许在保持绝对数据主权的同时,对生命体征、活动水平和睡眠模式进行深度技术分析。

该技能提供了强大的后端基础设施,包括自动化 webhook 设置、基于令牌的身份验证以及对各种 HTTPS 隧道方法的支持。通过将其集成到您的 Openclaw Skills 库中,您可以将智能体转变为个性化的健康数据科学家,能够跟踪长期趋势并提供具有操作性的生理见解。

下载入口:https://github.com/openclaw/skills/tree/main/skills/brandons7/vitavault

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install vitavault

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 vitavault。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

VitaVault 应用场景

  • 创建自动化的早报,总结睡眠质量、心率变异性 (HRV) 和恢复指标。
  • 通过将数月的数据合成简洁的摘要,为医疗专业人员生成详细的纵向健康报告。
  • 构建主动警报系统,检测静息心率或血氧水平的显著偏差。
  • 将日常活动水平与存储在 AI 智能体中的生产力或情绪日志进行关联。
VitaVault 工作原理
  1. Openclaw Skills 智能体通过生成唯一的 32 字节十六进制同步令牌来初始化安全环境。
  2. 在宿主机上启动本地 Python webhook 服务器,以传入的健康数据负载。
  3. 使用 Tailscale Funnel 或 Cloudflare Tunnels 等工具,通过加密的 HTTPS 隧道将 webhook 暴露给互联网,以满足 iOS 安全要求。
  4. 用户使用生成的端点 URL 和同步令牌配置 VitaVault iOS 应用。
  5. 在应用启动或手动触发时,iPhone 将加密的健康快照直接推送到智能体。
  6. 数据以结构化 JSON 格式保存在本地,随时可通过提供的分析脚本进行查询。

VitaVault 配置指南

要在 Openclaw Skills 环境中设置 VitaVault,首先创建配置目录并生成安全同步令牌:

mkdir -p ~/.config/vitavault
python3 -c "import secrets; print(secrets.token_hex(32))" > ~/.config/vitavault/sync-token
TOKEN=$(cat ~/.config/vitavault/sync-token)

接下来,在后台启动 webhook 器:

VITAVAULT_SYNC_TOKEN="$TOKEN" nohup python3 scripts/webhook.py --host 0.0.0.0 --port 8787 > /tmp/vitavault-webhook.log 2>&1 &

最后,通过 HTTPS 暴露服务。如果您安装了 Tailscale,请使用 Funnel:

sudo tailscale funnel --bg --set-path /vitavault http://127.0.0.1:8787

将生成的 URL 和令牌提供给 VitaVault iOS 应用的“设置 > OpenClaw”部分。

VitaVault 数据架构与分类体系

VitaVault 使用结构化架构将数据本地存储在 ~/vitavault/data/ 中,该架构对健康指标进行分类,以便 AI 检索。

组件 描述 格式
生命体征 心率、HRV、静息心率、血氧 时间序列 JSON
活动 步数、活动能量和距离 每日聚合
睡眠 睡眠阶段(REM、深睡、核心睡眠)和时长 基于会话的 JSON
元数据 源设备、单位类型和时间戳 标准化元数据

查询通过 scripts/query.py 执行,允许智能体获取“最新”快照、“周”摘要或特定的日期“范围”。

name: vitavault
description: VitaVault iOS app integration - sync Apple Health data directly to your AI agent. Auto-setup webhook, token generation, and HTTPS exposure. Works with any iPhone, no Mac required.
license: Apache-2.0
compatibility: Any OpenClaw agent. Pairs with VitaVault iOS app (free on App Store).
metadata:
  category: health
  platforms: ios
  author: BrandonS7

VitaVault - Your Health, Decoded

Sync Apple Health data from VitaVault iOS app directly to your OpenClaw agent. No shared servers, no middleman - data flows phone to your agent only.

No Mac required. Install VitaVault from TestFlight (beta) or the App Store.

Agent Setup Guide (DO THIS WHEN USER SAYS "set up VitaVault")

When your user asks to set up VitaVault sync, follow these steps automatically. Don't ask the user to do the technical parts - handle it yourself and hand them the URL + token at the end.

Step 1: Generate a sync token

# Generate a secure random token
python3 -c "import secrets; print(secrets.token_hex(32))" > ~/.config/vitavault/sync-token
mkdir -p ~/.config/vitavault
TOKEN=$(cat ~/.config/vitavault/sync-token)
echo "Token: $TOKEN"

Step 2: Start the webhook

VITAVAULT_SYNC_TOKEN="$TOKEN" nohup python3 scripts/webhook.py --host 0.0.0.0 --port 8787 > /tmp/vitavault-webhook.log 2>&1 &

The webhook listens for health data POSTs and saves snapshots to ~/vitavault/data/.

Step 3: Expose it over HTTPS

The VitaVault iOS app requires HTTPS (iOS App Transport Security). You MUST expose the webhook over HTTPS. Detect what's available and use the first option that works:

Option A: Tailscale Funnel (recommended if Tailscale is installed)

# Check if Tailscale is available
tailscale status 2>/dev/null
# If yes, expose via Funnel:
sudo tailscale funnel --bg --set-path /vitavault http://127.0.0.1:8787
# Your URL will be: https:///vitavault
tailscale funnel status  # to see the URL

Option B: Cloudflare Tunnel (if cloudflared is installed)

cloudflared tunnel --url http://localhost:8787
# Gives you a temporary https://*.trycloudflare.com URL
# For permanent: set up a named tunnel with a custom domain

Option C: VPS with a domain + reverse proxy (nginx/caddy) If the host already has a domain with HTTPS (nginx, caddy, etc.), add a reverse proxy rule:

location /vitavault {
    proxy_pass http://127.0.0.1:8787;
}

URL would be: https://yourdomain.com/vitavault

Option D: ngrok (quick testing)

ngrok http 8787
# Gives you a temporary https://*.ngrok-free.app URL

Step 4: Verify it works

curl -s https://YOUR-URL/health
# Should return: {"ok": true}

Step 5: Give the user their credentials

Tell your user:

Open VitaVault on your iPhone -> Settings -> OpenClaw

Webhook URL: https://YOUR-URL Sync Token:

Paste both in and tap Connect.

That's it. Once connected, VitaVault auto-syncs health data every time the app opens.

The webhook should survive reboots. Create a systemd service:

cat > /tmp/vitavault-webhook.service << 'EOF'
[Unit]
Description=VitaVault Webhook Receiver
After=network.target

[Service]
Type=simple
User=$USER
Environment=VITAVAULT_SYNC_TOKEN=
ExecStart=/usr/bin/python3 /path/to/skills/vitavault/scripts/webhook.py --host 127.0.0.1 --port 8787
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF
# Adjust paths and token, then:
sudo cp /tmp/vitavault-webhook.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now vitavault-webhook

Querying Health Data

Once data is syncing, use these scripts to read it:

# Latest snapshot summary
python3 scripts/summary.py

# Raw latest JSON
python3 scripts/query.py latest

# Last 7 days
python3 scripts/query.py week

# Date range
python3 scripts/query.py range 2026-02-01 2026-02-28

Data is stored locally at ~/vitavault/data/ as timestamped JSON files.

What You Can Do With the Data

Once synced, your agent can:

  • Track trends in steps, sleep, HRV, resting HR, blood oxygen
  • Compare current week vs prior week
  • Detect unusual drops/spikes and flag risks
  • Build morning health briefings
  • Generate doctor appointment summaries
  • Suggest habit changes based on actual data

Working with Manual Exports

Users can also export data manually from VitaVault (no webhook needed):

AI-Ready Format (Plain Text)

Pre-formatted for AI analysis. Users export from VitaVault and paste directly.

JSON Format

Structured data with nested metrics, dates, and units.

CSV Format

One row per day, opens in Excel/Google Sheets.

When a user shares an export:

  1. Acknowledge the data
  2. Highlight 2-3 key observations (positive and concerning)
  3. Give 3 specific, actionable recommendations
  4. Offer to dig deeper into any metric

Privacy

VitaVault sync data flows directly: iPhone -> your OpenClaw agent. No shared backend, no central relay, no third-party storage. Data is saved on your agent's host at ~/vitavault/data/ and nowhere else.

  • App: VitaVault on TestFlight (beta)
  • Website: vitavault.io
  • Developers: vitavault.io/developers
  • Privacy: vitavault.io/privacy