Persistent Store
The key/value store behind Tier 3 stateful widgets.
Tier 3 components — todo_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}endpointReturn the JSON value stored under key, or an empty/default value if none exists.
curl http://127.0.0.1:8000/api/store/todo_mainWrite
POST /api/store/{key}endpointPersist a JSON body under key, overwriting any previous value.
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}endpointRemove the value stored under key.
curl -X DELETE http://127.0.0.1:8000/api/store/todo_mainKeys & 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:
{ "type": "todo_list", "id": "groceries" }
{ "type": "todo_list", "id": "work" }Runtime data (including the store) lives under your device. The store survives agent restarts, which is what makes Tier 3 widgets "remember" across sessions.