ストア

ストア - 作成、一覧、削除。

ストアとは、読み書きの単位となる user_id です - エンドユーザー、エージェント、トピックごとに隔離された記憶空間になります。ストアは明示的です。保存や呼び出しの前に作成しないと、呼び出しは 404 を返します。すべてのアカウントには最初から default ストアがあるため、作成の呼び出しなしでも始められます。

隔離の入れ子構造。アカウントがワークスペースを持ち、各ワークスペースは記憶・API キー・使用量をそれぞれ隔離します(請求はアカウントで共有)。ストアはワークスペースの中にあり、同じワークスペースのキーはそのストアを共有し、異なるワークスペース同士が互いの記憶を見ることはありません。アカウント → ワークスペース → ストア (user_id) → 記憶
mem.create_store("alice")        # create (idempotent)
mem.list_stores()              # [{"user_id","created_at"}, ...]
mem.delete_store("alice")        # delete the store + all its memories
await mem.createStore("alice");
await mem.listStores();          // [{ user_id, created_at }, ...]
await mem.deleteStore("alice");     // store + all its memories
mem.create_store("alice").await?;
let stores = mem.list_stores().await?;
mem.delete_store("alice").await?;
# create
curl -X POST https://api.wontopos.com/api/v1/memory/collection \
  -H "X-API-Key: $WOS_API_KEY" -H "Content-Type: application/json" -d '{"user_id":"alice"}'
# list
curl https://api.wontopos.com/api/v1/memory/collections -H "X-API-Key: $WOS_API_KEY"
# delete (store + all its memories)
curl -X DELETE https://api.wontopos.com/api/v1/memory/collection \
  -H "X-API-Key: $WOS_API_KEY" -H "Content-Type: application/json" -d '{"user_id":"alice"}'
実際のレスポンス - 作成
{ "user_id": "alice", "status": "created" }   // "exists" if it already did
実際のレスポンス - 一覧
{ "collections": [
  { "user_id": "default", "created_at": "2026-06-26T02:23:14Z" },
  { "user_id": "alice",   "created_at": "2026-06-26T02:24:01Z" }
], "count": 2 }
存在しないストアへの recall
{ "error": { "type": "not_found_error",
  "message": "Store 'ghost' does not exist. Create it first with
              POST /api/v1/memory/collection {\"user_id\":\"ghost\"}, then store or recall." } }
エンドユーザーごとにストアをひとつ("alice""user_42")使えば、各人の記憶を分離できます。個人用エージェントなら default ストアひとつでも構いません。コンソール(Memory ids → Issue)からコードを書かずにストアの作成・閲覧もできます。ストアの削除は恒久的で、その中のすべての記憶が消えます。 ストア id は保存前に畳まれます。小文字化され、[a-z0-9_] 以外の文字は _ になるため、Alice.Smithalice-smith は同じストアです。既存 id と同じ形に畳まれる二つ目の id は、黙って共有されるのではなく 409 で拒否されます。id 自体も [A-Za-z0-9][A-Za-z0-9._-]{0,63} を満たす必要があるため、メールアドレスや非ラテン文字の名前はストア id にできません。内部識別子をお使いください。

ストアの一覧取得と削除

mem.list_stores()                # [{"user_id","created_at"}, …]
mem.delete_store("alice")      # the store and every memory in it
await mem.listStores();
await mem.deleteStore("alice");
let stores = mem.list_stores().await?;
mem.delete_store("alice").await?;
curl -X POST   .../api/v1/memory/collections -d '{}'
curl -X DELETE .../api/v1/memory/collection  -d '{"user_id":"alice"}'