H

Hank, the reactive keystore

Keystore · Layer 3

"Remembers what was said. Tells you when it changes."
Protocol status: draft

What Hank does

Hank keeps durable, keyed records of what the platform needs to remember, such as settings, state, commands and schedules, and tells anyone listening the moment one changes.

Per-key records

Every key is its own record with a monotonic version and a last-modified time, so independent keys never overwrite each other.

Reactive pub/sub

Subscribe to a key or a glob pattern and get notified on change. No polling.

A public protocol

HANK/1 is a documented WebSocket protocol, with a read-only HTTP fallback. Any language can speak it.

Encrypted at rest

Records are sealed with the platform's master key. SQLite is the default backend and it's pluggable.

Fleet-aware namespaces

Reserved kevin: prefixes mirror the device registry, telemetry and the command channel, so apps can read live fleet state.

A module, not a service

Hank is mounted inside the Kevin daemon. One config flag turns it on, and when it's off nothing runs.

How it works

Hank speaks a small, versioned protocol over WebSocket. A client sets a key and gets back a version, and other clients hear about it.

  1. A client opens a WebSocket and sets a key. Hank acknowledges with the new version.
  2. Other clients subscribed to a matching pattern receive an event.
  3. Anyone can read the current record, over WebSocket or HTTP.
client → {"op":"set","key":"kevin:cmd:restart-pump-17","value":{...}}
server → {"ack":true,"version":7,"updated_at":1712345678901}

client → {"op":"subscribe","pattern":"kevin:device:*"}
server → {"event":"set","key":"kevin:device:kv-pump-17","record":{...}}

Where it fits in the four layers

1 Infrastructure & roles Vera, Grant, the bus, the device registry
2 Data pipeline & state Flo, DynaRAG, the carousel
3 Reasoning & inference Rick, Annie, Max, Hank
4 UI & collaboration Marco, Noted, Norm, the graph

Hank is layer 3 state that the other layers read through the daemon. The daemon uses it to mirror device state, telemetry and commands, and Marco reads it too.