Metadata-Version: 2.4
Name: baseline-health
Version: 0.8.0
Summary: AI health coach for Claude. Tracks 20 metrics, scores your health coverage, coaches you through 14-day focused programs. Local-first, your data stays on your machine.
License-Expression: MIT
Project-URL: Homepage, https://mybaseline.health
Project-URL: Repository, https://github.com/a-deal/kiso
Keywords: health,mcp,claude,scoring,wearables,coaching,baseline
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: pyyaml>=6.0
Requires-Dist: mcp[cli]>=1.6.0
Provides-Extra: garmin
Requires-Dist: garminconnect>=0.2.0; extra == "garmin"
Provides-Extra: calendar
Requires-Dist: google-api-python-client>=2.100; extra == "calendar"
Requires-Dist: google-auth-httplib2>=0.2; extra == "calendar"
Requires-Dist: google-auth-oauthlib>=1.2; extra == "calendar"
Provides-Extra: gateway
Requires-Dist: fastapi>=0.115; extra == "gateway"
Requires-Dist: uvicorn>=0.32; extra == "gateway"
Requires-Dist: cryptography>=42.0; extra == "gateway"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Dynamic: license-file

# Kiso (基礎)

The backend platform for [Kasane](https://kasanelife.com) and Milo.

Kiso is a health intelligence server that powers two clients: the Kasane iOS app (habits, coaching, focus plans) and Milo (an AI coaching agent on WhatsApp). Both read and write the same person profiles, habits, check-ins, and health data through a shared API.

The name means "foundation" in Japanese. Kasane means "layers." Kiso is what the layers sit on.

## What it does

**For the iOS app**: bidirectional sync of persons, habits, check-ins, focus plans, and health measurements via REST API.

**For Milo**: 40+ MCP tools for health coaching. Log weight, meals, labs, blood pressure. Pull data from Garmin, Apple Health, Oura, Whoop. Score 20 health metrics against NHANES population percentiles and clinical guidelines.

**For both**: a unified person context that merges Kasane data (SQLite) with health tracking data (CSVs) in one call.

## Quick start

```bash
git clone https://github.com/a-deal/kiso.git
cd kiso
pip install -e ".[gateway,dev]"

# Run the gateway
python3 -m uvicorn engine.gateway.server:create_app --factory --port 18800

# Run tests
python3 -m pytest tests/ -v
```

### MCP server (for Claude Desktop / Claude Code)

```json
{
  "mcpServers": {
    "kiso": {
      "command": "uvx",
      "args": ["kiso"]
    }
  }
}
```

## API surfaces

| Surface | Path | Client |
|---------|------|--------|
| Kasane sync | `POST /api/v1/sync` | iOS app |
| Kasane CRUD | `/api/v1/persons`, `/api/v1/habits`, etc. | iOS app |
| Person context | `GET /api/v1/persons/:id/context` | Milo |
| Health tools | `/api/{tool_name}` | Milo, iOS Shortcuts |
| Wearable auth | `/auth/garmin`, `/auth/google` | Browser (OAuth) |

Full API reference: [docs/API.md](docs/API.md)

## Architecture

One Python process. Two storage systems. Three clients.

- **SQLite** (`data/kasane.db`): persons, habits, check-ins, focus plans. Synced with iOS.
- **CSVs** (`data/`): weight, meals, labs, Garmin, supplements. Written by Milo's tools.
- **Bridge**: `person.health_engine_user_id` links a SQLite person to a CSV data directory.

Full architecture: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)

## Health scoring

20 clinically validated metrics scored against NHANES population data (300K+ Americans) and clinical guidelines from AHA, ADA, and ESC. Covers cardiovascular, metabolic, body composition, recovery, and lifestyle dimensions.

Going from 0% to full coverage costs under $300.

Full methodology: [docs/METHODOLOGY.md](docs/METHODOLOGY.md)

## Docs

| Doc | What's in it |
|-----|-------------|
| [ARCHITECTURE.md](docs/ARCHITECTURE.md) | System design, storage model, deploy model, project layout |
| [API.md](docs/API.md) | v1 endpoints, sync protocol, data types |
| [ROADMAP.md](docs/ROADMAP.md) | Cloud adoption phases (JWT, Litestream, Supabase) |
| [METHODOLOGY.md](docs/METHODOLOGY.md) | Why each metric, evidence sources, clinical thresholds |
| [SCORING.md](docs/SCORING.md) | How the scoring engine works |
| [METRICS.md](docs/METRICS.md) | 20-metric catalog |
| [DATA_FORMATS.md](docs/DATA_FORMATS.md) | CSV/JSON schemas |
| [ONBOARDING.md](docs/ONBOARDING.md) | Setup walkthrough |

## License

MIT
