Persistent Store

The key/value store behind Tier 3 stateful widgets.

Tier 3 componentstodo_list, notes, kanban_board, and friends — persist their state through a simple key/value store on the agent. Each widget reads and writes its own key automatically; you can also use the endpoints directly.

Read

GET /api/store/{key}endpoint

Return the JSON value stored under key, or an empty/default value if none exists.

bash
curl http://127.0.0.1:8000/api/store/todo_main

Write

POST /api/store/{key}endpoint

Persist a JSON body under key, overwriting any previous value.

bash
curl -X POST http://127.0.0.1:8000/api/store/todo_main \
 -H "Content-Type: application/json" \
 -d '{"items": [{"text": "Ship docs", "done": false}]}'

Delete

DELETE /api/store/{key}endpoint

Remove the value stored under key.

bash
curl -X DELETE http://127.0.0.1:8000/api/store/todo_main

Keys & widgets

A Tier 3 widget's id property determines its store key. Two widgets sharing an id share state; give them distinct ids to keep separate data:

json
{ "type": "todo_list", "id": "groceries" }
{ "type": "todo_list", "id": "work" }
Note

Runtime data (including the store) lives under your device. The store survives agent restarts, which is what makes Tier 3 widgets "remember" across sessions.