Skip to main content
Glama
README.md
# Household Agent

**English** | [🌐 δΈ­ζ–‡](./README_CN.md)

AI-powered household management β€” let AI handle the small daily decisions so you don't have to.

Track groceries, predict restocking needs, plan meals from what's in your fridge, and monitor baby supplies β€” all through Claude Code (MCP), CLI, or a local web dashboard.

## Quick Start

```bash
npm install
npm start          # Web dashboard at http://localhost:3333
```

## Usage

### Claude Code (MCP)

Add to your Claude Code MCP config (`~/.claude/settings.json`):

```json
{
  "mcpServers": {
    "household": {
      "command": "node",
      "args": ["/path/to/household/skills/mcp-server.js"]
    }
  }
}
```

Then just talk naturally:

- "What groceries do we have?" β†’ `inventory_list`
- "What do we need to buy this week?" β†’ `shopping_list`
- "How many days of baby formula left?" β†’ `baby_supply_status`
- "Log 3 diapers used" β†’ `baby_log_event`
- "What can I cook with what's in the fridge?" β†’ `meal_suggestions`

### OpenClaw

Import the `skills/` folder via OpenClaw Skill Manager, or add MCP config:

```
command: node
args: [/path/to/household/skills/mcp-server.js]
```

Skill metadata is defined in [`skills/SKILL.md`](./skills/SKILL.md).

### CLI

```bash
node skills/inventory.js add <barcode or name>     # Add item (auto-lookup via Open Food Facts)
node skills/inventory.js consume <ID or name> [qty] # Record consumption
node skills/inventory.js list [location]            # View inventory
node skills/inventory.js expiring [days]            # Expiring items (default 7 days)
node skills/inventory.js status                     # Dashboard summary
```

### Web Dashboard

`http://localhost:3333` β€” tabs for inventory, restock, cooking, calendar, baby tracking, and settings.

## Architecture

```
household/
β”œβ”€β”€ skills/
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ data.js            # Shared data layer (atomic JSON I/O, paths, utils)
β”‚   β”‚   β”œβ”€β”€ inventory-ops.js   # Inventory CRUD + restock logic
β”‚   β”‚   β”œβ”€β”€ baby-ops.js        # Baby log operations
β”‚   β”‚   └── meal-ops.js        # Meal diary + cooking recommendations
β”‚   β”œβ”€β”€ mcp-server.js          # MCP server (12 tools, stdio transport)
β”‚   β”œβ”€β”€ server.js              # Express web server + API
β”‚   β”œβ”€β”€ inventory.js           # CLI entry point
β”‚   β”œβ”€β”€ predict.js             # Consumption prediction engine
β”‚   └── public/index.html      # Single-page web dashboard
β”œβ”€β”€ data/                      # JSON data files (gitignored)
└── config/                    # Category, preference, and location configs
```

Three entry points β€” MCP server, web server, and CLI β€” share a common data layer (`lib/`), operating on the same JSON files.

## MCP Tools

| Tool | Description |
|------|-------------|
| `inventory_list` | List inventory with filters (location, category, status) |
| `inventory_add` | Add item with optional barcode lookup |
| `inventory_consume` | Record consumption by ID or name |
| `inventory_expiring` | Items expiring within N days |
| `inventory_status` | Summary stats (totals, by location/category) |
| `restock_recommendations` | Smart restock suggestions based on consumption rate |
| `meal_suggestions` | What to cook based on available ingredients |
| `shopping_list` | Combined shopping list (restock + expiring + recipe gaps) |
| `baby_log_event` | Log baby events (feeding, diaper, sleep, etc.) |
| `baby_supply_status` | Baby supply levels and days-until-empty predictions |
| `preferences_get` | Read household preferences |
| `preferences_update` | Update a preference field |

## Key Features

- **Consumption prediction** β€” tracks usage patterns to predict when items run out
- **Smart restock** β€” auto-generates shopping lists based on consumption velocity
- **Recipe gap matching** β€” finds dishes you can almost make (missing just 1 ingredient)
- **Baby tracking** β€” feeding, diaper, sleep logging with supply predictions
- **Barcode scanning** β€” auto-lookup via Open Food Facts API
- **Image recognition** β€” identify items via Claude Vision (web dashboard)

## Baby Tracker Import

Import baby life records from [Baby Tracker](https://nighp.com/babytracker/) app (`.btcp` format):

```bash
node skills/import-btcp.js <file.btcp> [--dry-run] [--tz=8]
```

Or upload via web dashboard at Settings β†’ Import.

## Data Storage

All data is local JSON files β€” no cloud, no database server, no account required. Atomic writes (write-tmp-then-rename) prevent corruption.

## License

Apache License 2.0 β€” see [LICENSE](./LICENSE).

Premium features and add-on services may be offered under separate terms.