memory.put
Store a fact with its source and validity window, replacing any same-id item, so later reads return only trusted, non-stale data.
Instructions
Writes one memory item for this tenant, or replaces the item with the same id, in the body's state directory on this machine. Use it to keep a fact for a later memory.get together with where it came from and how long it holds, so a stale fact is not served later. The call passes the policy gate and is recorded; the record carries the item's versionHash, a SHA-256 over id, body and validity window. Returns {ok: true, id, versionHash}. A missing source answers {error: "source-required"}, a missing validUntilMs {error: "validUntilMs-required"}, a malformed id {error: "id-invalid"}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Identifier to store under and read back with memory.get: 1 to 128 characters of letters, digits, '.', '_' or '-', starting with a letter or digit; case-sensitive. An existing item with this id is replaced. | |
| body | Yes | The value to keep, as any JSON: object, array, string, number or boolean. Stored as given and returned as given by memory.get. | |
| source | Yes | Where the value came from, as a JSON object of your choosing, for example {"kind": "document", "ref": "invoice-2026-09.pdf"}. Required; stored with the item so a later reader can weigh it. | |
| validFromMs | No | Optional. Unix time in milliseconds from which the item may be served; before it memory.get answers notYetValid. Omit to serve it at once. | |
| validUntilMs | Yes | Required. Unix time in milliseconds after which memory.get answers stale and withholds the body. Pick the moment the fact should no longer be trusted. |