Governed runtime + skills for a multi-domain personal health agent (recovery, running, sleep, stress, strength, nutrition).
Project description
Health Agent Infra
Health Agent Infra is a governed runtime for a multi-domain
personal health agent. One Claude agent reads a cross-domain
state snapshot, emits per-domain proposals via domain skills, and a
synthesis skill reconciles them via codified cross-domain rules
into bounded per-domain recommendations validated at the hai writeback boundary.
It is not a chatbot, a wearable API, a general AI health app, or a clinical product. It is infrastructure the agent consumes: deterministic Python tools that ingest evidence, classify state, apply policy, run synthesis, and persist recommendations, plus markdown skills that instruct the agent in how to compose rationale and surface uncertainty once actions are mechanically constrained.
- Python = tools (data acquisition, projection, band classification, R-rule + X-rule evaluation, schema validation, atomic transactions, evals).
- Markdown = skills (judgment: picking from an already-constrained action set, composing rationale, surfacing uncertainty).
- The code-vs-skill boundary is tight and the plan documents it. Skills never change an action; code never writes prose.
Six domains in v1
recovery · running · sleep · stress · strength · nutrition
Each ships per-domain schemas, classify, policy, a readiness skill,
and is wired into the synthesis X-rule catalogue. Nutrition is
macros-only in v1 (no meal-level / food taxonomy / micronutrient
inference) per the Phase 2.5 retrieval-gate outcome — see
reporting/docs/non_goals.md.
Runtime at a glance
pull / intake → projectors → accepted_*_state_daily tables
│
▼
hai state snapshot --as-of <date>
│
▼
domain skills emit DomainProposal × 6
│ hai propose
▼
proposal_log
│
▼
Phase A X-rules (X1–X7) → runtime applies mutations to drafts
│
▼
daily-plan-synthesis skill overlays rationale
│
▼
Phase B X-rules (X9) → action_detail adjustments
│
▼
ATOMIC COMMIT: daily_plan + x_rule_firings + N recommendations
│
▼
hai review schedule / record / summary
See reporting/docs/architecture.md
for the full pipeline + code-vs-skill boundary.
Install
pip install -e . # or pip install health_agent_infra once published
hai setup-skills # copies skills into ~/.claude/skills/
hai state init # initialises the local SQLite state DB
hai --help
CLI surface
# Evidence + intake
hai pull [--live] --date <d> # Garmin CSV / live pull
hai clean --evidence-json <p> # raw → CleanedEvidence + RawSummary
hai intake gym|exercise|nutrition|stress|note|readiness ...
# State
hai state init | migrate | read | snapshot | reproject
# Per-domain debug
hai classify --domain <d> --evidence-json <p>
hai policy --domain <d> --evidence-json <p>
# Agent flow
hai propose --domain <d> --proposal-json <p>
hai synthesize --as-of <d> --user-id <u>
# Persistence + review
hai writeback --recommendation-json <p>
hai review schedule | record | summary [--domain <d>]
# Auth + config + helpers
hai auth garmin | status
hai config init | show
hai exercise search --query <free-text>
# Evals
hai eval run --domain <d> | --synthesis [--json]
hai setup-skills
Read this repo in 5 minutes
- Architecture overview —
reporting/docs/architecture.md - X-rule catalogue —
reporting/docs/x_rules.md - Non-goals (scope discipline) —
reporting/docs/non_goals.md - State schema —
reporting/docs/state_model_v1.md - 10-minute reading tour —
reporting/docs/tour.md - Eval capture —
reporting/artifacts/flagship_loop_proof/2026-04-18-multi-domain-evals/
Repo layout
src/health_agent_infra/
├── cli.py # hai dispatcher
├── core/
│ ├── schemas.py validate.py config.py
│ ├── synthesis.py synthesis_policy.py
│ ├── writeback/ state/ clean/ pull/ review/
│ └── intake/
├── domains/
│ ├── recovery/ running/ sleep/ stress/ strength/ nutrition/
│ └── each: schemas.py classify.py policy.py [+ signals/intake]
├── skills/
│ ├── recovery-readiness/ running-readiness/ sleep-quality/
│ ├── stress-regulation/ strength-readiness/ nutrition-alignment/
│ ├── daily-plan-synthesis/
│ └── strength-intake/ merge-human-inputs/ writeback-protocol/
│ reporting/ safety/
└── data/garmin/export/ # committed CSV fixture
reporting/
├── docs/ # architecture, x_rules, non_goals, ...
├── artifacts/flagship_loop_proof/ # eval runner captures
├── plans/ # comprehensive rebuild plan + gates
└── experiments/ # Phase 0.5 / 2.5 throwaway prototypes
safety/
├── tests/ # 1200+ unit + contract + integration
└── evals/ # Phase 6 eval framework (28 scenarios)
What's proven in v1
- Six domains end-to-end: classify → policy → skill proposal → synthesis → writeback → review.
- Ten X-rule evaluators across two phases with atomic transactional commits.
- Garmin live pull via keyring (
hai auth garmin+hai pull --live). - Idempotent synthesis with optional
--supersedeversioning. - 28 eval scenarios (18 domain + 10 synthesis) all green.
- 1200+ tests covering every band, every R-rule, every X-rule, atomic transaction semantics, writeback invariants, skill-boundary contracts.
What's not
- Not a medical device, not hosted, not multi-user, not an ML
loop. See
reporting/docs/non_goals.md. - Not meal-level nutrition in v1.
- Not a skill-narration eval harness yet (Phase 2.5 Track B
Condition 3 deferred — see
safety/evals/skill_harness_blocker.md). - Not a polished wheel install / first-run wizard (Phase 7).
Contributing
See CONTRIBUTING.md. The authoritative rebuild
plan lives at
.claude/worktrees/hardcore-kare-a92e25/reporting/plans/comprehensive_rebuild_plan.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file health_agent_infra-0.1.0.tar.gz.
File metadata
- Download URL: health_agent_infra-0.1.0.tar.gz
- Upload date:
- Size: 209.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e927bf3aa6e963e44725cb62d340c7d378bc650310eb7effa800ffd2e7d53e8
|
|
| MD5 |
ad92fcfc3e36c3e28009b1e8942e04f0
|
|
| BLAKE2b-256 |
4354f58ad03c0be75d59f7ef2729df51730499a2900acf8b3afa22de3bbc481d
|
File details
Details for the file health_agent_infra-0.1.0-py3-none-any.whl.
File metadata
- Download URL: health_agent_infra-0.1.0-py3-none-any.whl
- Upload date:
- Size: 258.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
547e4104288a46b4020ffe6f5ceade46047ad2bf7623ecadb46da0f3aada275e
|
|
| MD5 |
58c12211a0f6ea71934640543387c904
|
|
| BLAKE2b-256 |
b74dd86469bb6bf1f835441bbba87c12b96451926cc5bef89831d5a586df748d
|