Inspiration

During an outage, a household with a battery has a simple but difficult question: what must stay on, and how long will the stored energy last? Most dashboards show readings, but the person still has to compare hourly demand, reserve limits and changing forecasts by hand.

I built WattKeep to test a better working relationship. A browser agent handles the calculations and comparisons. The household sees the evidence, reviews the proposed change and keeps the final say.

What it does

WattKeep is a deterministic, local-first outage planner. The demonstration follows the Morgan household through a twelve-hour outage with 10.53 kWh stored in a 13.5 kWh battery and a protected reserve of 20 percent.

A WebMCP agent can inspect the household and outage, simulate three plans, compare their reserve safety, explain an unsafe hourly interval, stage a feasible alternative and request human review. WattKeep exposes eight page-scoped tools:

  • inspect_home
  • inspect_outage
  • simulate_plan
  • compare_plans
  • stage_plan
  • explain_interval
  • discard_plan
  • request_review

The agent cannot approve, commit or undo a policy change. Those actions stay in the visible human interface. If the forecast or workspace changes while a proposal is awaiting confirmation, WattKeep rejects the stale proposal and requires a fresh calculation.

How I built it

WattKeep is a React, TypeScript and Vite single-page application. A deterministic simulator and an observable local store power both the human interface and the WebMCP adapter. The adapter registers its tools through document.modelContext, with constrained JSON schemas and structured success or recoverable-error results.

Every staged proposal records a proposal ID, base revision, scenario and simulation fingerprint. Commit-time validation checks those values against the current workspace before a person can apply the change. Human commits, undo, forecast refresh, discard and session reset are recorded in an append-only journal.

The application remains fully usable when WebMCP is unavailable. It stores a versioned workspace locally and falls back to memory-only operation if browser persistence fails.

Challenges I ran into

The hardest design problem was giving the agent enough authority to be useful without letting it cross the household's decision boundary. Inspection and simulation are safe to automate. Applying a policy is not, so I separated proposal preparation from human confirmation and removed commit and undo from the tool surface.

Stale evidence was the second problem. A proposal may be valid when it is created and wrong after a forecast refresh. Revision and fingerprint checks turn that race into a visible, recoverable error instead of silently applying outdated advice.

I also kept the demonstration honest. WattKeep is a planning simulator. It does not connect to or control batteries, inverters or household circuits.

Accomplishments that I am proud of

  • The human interface and all eight WebMCP tools share one state model.
  • The video shows tool calls changing the same state the person can see.
  • Human-only commit and undo controls preserve the final decision.
  • Stale-proposal rejection protects a decision after its evidence changes.
  • The public build passed 62 unit tests, 15 WebMCP contract tests, 13 end-to-end tests and 7 accessibility and responsive checks.

What I learned

A page does not become agent-ready merely by exposing machine-callable actions. The useful part is the contract around those actions: clear descriptions, constrained inputs, inspectable results, versioned state and visible human boundaries.

WebMCP removes much of the guesswork involved in operating a graphical interface. WattKeep showed me that reliable human-agent collaboration also needs transaction-style safety, especially when an agent prepares a decision that a person must approve later.

What's next for WattKeep

The next version could import read-only battery, load and forecast data from supported household systems, allow people to define their own appliances and compare saved scenarios across different outage windows. Any future connection to household equipment would retain explicit review and human-controlled policy changes. Inspiration

Built With

Share this project:

Updates

Submission history