memory_versions
Creates, updates, deletes, gets or lists a memory_versions resource.
Overview
| Name | memory_versions |
| Type | Resource |
| Id | anthropic.memory_stores.memory_versions |
Fields
The following fields are returned by SELECT queries:
- get
- list
Successful response (OK)
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for this version (a `memver_...` value). |
memory_id | string | ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/en/api/beta/memory_stores/memory_versions/list) to retrieve the full lineage including the `deleted` row. |
memory_store_id | string | ID of the memory store this version belongs to (a `memstore_...` value). |
content | string | The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set. |
content_sha256 | string | Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise. |
content_size_bytes | integer (int32) | Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise. |
created_at | string (date-time) | When this version was written, in RFC 3339 format. |
created_by | object | Who performed this write: a `session_actor`, `api_actor`, or `user_actor`. Captured at write time and preserved through redaction. |
operation | string | The kind of mutation this version records: `created`, `modified`, or `deleted`. (created, modified, deleted) |
path | string | The memory's path at the time of this write. `null` if and only if `redacted_at` is set. |
redacted_at | string (date-time) | When this version was redacted, in RFC 3339 format, or `null` if it has not been redacted. When set, `content`, `path`, `content_size_bytes`, and `content_sha256` are all `null`. See [Redact a memory version](/en/api/beta/memory_stores/memory_versions/redact). |
redacted_by | object | Who redacted this version, or `null` if it has not been redacted. In practice always an `api_actor` or `user_actor` (agents do not have a redact capability). |
type | string | (memory_version) |
Successful response (OK)
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for this version (a `memver_...` value). |
memory_id | string | ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/en/api/beta/memory_stores/memory_versions/list) to retrieve the full lineage including the `deleted` row. |
memory_store_id | string | ID of the memory store this version belongs to (a `memstore_...` value). |
content | string | The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set. |
content_sha256 | string | Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise. |
content_size_bytes | integer (int32) | Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise. |
created_at | string (date-time) | When this version was written, in RFC 3339 format. |
created_by | object | Who performed this write: a `session_actor`, `api_actor`, or `user_actor`. Captured at write time and preserved through redaction. |
operation | string | The kind of mutation this version records: `created`, `modified`, or `deleted`. (created, modified, deleted) |
path | string | The memory's path at the time of this write. `null` if and only if `redacted_at` is set. |
redacted_at | string (date-time) | When this version was redacted, in RFC 3339 format, or `null` if it has not been redacted. When set, `content`, `path`, `content_size_bytes`, and `content_sha256` are all `null`. See [Redact a memory version](/en/api/beta/memory_stores/memory_versions/redact). |
redacted_by | object | Who redacted this version, or `null` if it has not been redacted. In practice always an `api_actor` or `user_actor` (agents do not have a redact capability). |
type | string | (memory_version) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | memory_store_id, memory_version_id | view | |
list | select | memory_store_id | memory_id, session_id, api_key_id, operation, created_at[gte], created_at[lte], view | |
redact | exec | memory_store_id, memory_version_id |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
memory_store_id | string | Path parameter memory_store_id |
memory_version_id | string | Path parameter memory_version_id |
api_key_id | string | Query parameter for api_key_id |
created_at[gte] | string (date-time) | Return versions created at or after this time (inclusive). |
created_at[lte] | string (date-time) | Return versions created at or before this time (inclusive). |
memory_id | string | Query parameter for memory_id |
operation | string | Query parameter for operation |
session_id | string | Query parameter for session_id |
view | string | Query parameter for view |
SELECT examples
- get
- list
Successful response (OK)
SELECT
id,
memory_id,
memory_store_id,
content,
content_sha256,
content_size_bytes,
created_at,
created_by,
operation,
path,
redacted_at,
redacted_by,
type
FROM anthropic.memory_stores.memory_versions
WHERE memory_store_id = '{{ memory_store_id }}' -- required
AND memory_version_id = '{{ memory_version_id }}' -- required
AND view = '{{ view }}'
;
Successful response (OK)
SELECT
id,
memory_id,
memory_store_id,
content,
content_sha256,
content_size_bytes,
created_at,
created_by,
operation,
path,
redacted_at,
redacted_by,
type
FROM anthropic.memory_stores.memory_versions
WHERE memory_store_id = '{{ memory_store_id }}' -- required
AND memory_id = '{{ memory_id }}'
AND session_id = '{{ session_id }}'
AND api_key_id = '{{ api_key_id }}'
AND operation = '{{ operation }}'
AND "created_at[gte]" = '{{ created_at[gte] }}'
AND "created_at[lte]" = '{{ created_at[lte] }}'
AND view = '{{ view }}'
;
Lifecycle Methods
- redact
Successful response (OK)
EXEC anthropic.memory_stores.memory_versions.redact
@memory_store_id='{{ memory_store_id }}' --required,
@memory_version_id='{{ memory_version_id }}' --required
;