memory

Store one memory

post/api/v1/memory/store

Request

  • Base URL: https://api.wontopos.com
  • URL: https://api.wontopos.com/api/v1/memory/store
  • Auth: API key in header X-API-Key

Headers

X-WOS-Modelstring

Which engine reads the memory (see GET /api/v1/models). All live models share one memory per workspace, so you can store with one and recall with another. A retired model answers 410 with error.type gone_error and error.code 0, except on DELETE /api/v1/memory/collection, which deletes the store under any model. Until then, a model scheduled to retire names the day in a Sunset header (RFC 8594) on every answer it serves, the same date GET /api/v1/models lists as retires_at.

Idempotency-Keystring

Makes repeating THIS EXACT write safe. Accepted on the writes: store, store-turn, bulk-store, supersede, forget, POST and DELETE collection, POST and DELETE speakers, DELETE image; a read ignores it. The key is kept for 24 hours: a repeat gets the first 2xx response again, with Idempotent-Replayed: true, instead of storing again, and the same key with a different body answers 422. A repeat that arrives while the first request is still running answers 409 with retry_after_ms: wait, then send it again. Only a 2xx is kept, so a call that failed can be sent again at once, with one exception: when the first request did not come back with an answer, or the memory engine failed part-way through it, whether it was stored is not known, and a repeat answers 409 without retry_after_ms rather than risk storing it twice. Use it when the retry is yours: a job that died and was re-run, a queue that redelivers. Derive the key from the thing being stored ("import:row-42"), never a constant: reusing one key for two different writes replays the first and the second is silently lost.

Request body

user_idstring required

The store to operate on. Stores are explicit: create one first or use the built-in "default". Use the id the store was created with: 1-64 ASCII letters, digits, ., _ or -, starting with a letter or digit. Ids that differ only by case name one store.

contentstring required

Response

Success.

idstring

Empty when status is "duplicate".

statusstring

"stored" on success — match on the prefix, since the string may carry a suffix, usually 1 — or "duplicate" when the write was dropped because a memory close enough IN MEANING already exists. Match on the prefix, not on equality.

notestring

Present when something non-fatal was dropped (e.g. a speaker tag on a duplicate).

Example response

{
  "status": "stored (1 chunks)"
}

Changes

No recorded changes to this operation across all 1 revision of this API.