Skip to main content

memories

Creates, updates, deletes, gets or lists a memories resource.

Overview

Namememories
TypeResource
Idgoogle.aiplatform.memories

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. Represents the resource name of the Memory. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}
createTimestring (google-datetime)Output only. Represents the timestamp when this Memory was created.
descriptionstringOptional. Represents the description of the Memory.
disableMemoryRevisionsbooleanOptional. Input only. Indicates whether no revision will be created for this request.
displayNamestringOptional. Represents the display name of the Memory.
expireTimestring (google-datetime)Optional. Represents the timestamp of when this resource is considered expired. This is always provided on output when expiration is set on input, regardless of whether expire_time or ttl was provided.
factstringOptional. Represents semantic knowledge extracted from the source content.
metadataobjectOptional. Represents user-provided metadata for the Memory. This information was provided when creating, updating, or generating the Memory. It was not generated by Memory Bank.
revisionExpireTimestring (google-datetime)Optional. Input only. Represents the timestamp of when the revision is considered expired. If not set, the memory revision will be kept until manually deleted.
revisionLabelsobjectOptional. Input only. Represents the labels to apply to the Memory Revision created as a result of this request.
revisionTtlstring (google-duration)Optional. Input only. Represents the TTL for the revision. The expiration time is computed: now + TTL.
scopeobjectRequired. Immutable. Represents the scope of the Memory. Memories are isolated within their scope. The scope is defined when creating or generating memories. Scope values cannot contain the wildcard character '*'.
topicsarrayOptional. Represents the Topics of the Memory.
ttlstring (google-duration)Optional. Input only. Represents the TTL for this resource. The expiration time is computed: now + TTL.
updateTimestring (google-datetime)Output only. Represents the timestamp when this Memory was most recently updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, memoryBanksId, memoriesIdGet a Memory.
listselectprojectsId, locationsId, memoryBanksIdpageSize, filter, pageToken, orderByList Memories.
createinsertprojectsId, locationsId, memoryBanksIdmemoryIdCreate a Memory.
patchupdateprojectsId, locationsId, memoryBanksId, memoriesIdupdateMaskUpdate a Memory.
deletedeleteprojectsId, locationsId, memoryBanksId, memoriesIdDelete a Memory.
purgeexecprojectsId, locationsId, memoryBanksIdPurge memories.
ingest_eventsexecprojectsId, locationsId, reasoningEnginesIdIngests events for a Memory Bank.
retrieveexecprojectsId, locationsId, memoryBanksIdRetrieve memories.
rollbackexecprojectsId, locationsId, memoryBanksId, memoriesIdRollback Memory to a specific revision.
generateexecprojectsId, locationsId, memoryBanksIdGenerate memories.

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.

NameDatatypeDescription
locationsIdstring
memoriesIdstring
memoryBanksIdstring
projectsIdstring
reasoningEnginesIdstring
filterstring
memoryIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Get a Memory.

SELECT
name,
createTime,
description,
disableMemoryRevisions,
displayName,
expireTime,
fact,
metadata,
revisionExpireTime,
revisionLabels,
revisionTtl,
scope,
topics,
ttl,
updateTime
FROM google.aiplatform.memories
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND memoryBanksId = '{{ memoryBanksId }}' -- required
AND memoriesId = '{{ memoriesId }}' -- required
;

INSERT examples

Create a Memory.

INSERT INTO google.aiplatform.memories (
data__revisionTtl,
data__scope,
data__topics,
data__fact,
data__name,
data__expireTime,
data__metadata,
data__ttl,
data__revisionLabels,
data__revisionExpireTime,
data__displayName,
data__description,
data__disableMemoryRevisions,
projectsId,
locationsId,
memoryBanksId,
memoryId
)
SELECT
'{{ revisionTtl }}',
'{{ scope }}',
'{{ topics }}',
'{{ fact }}',
'{{ name }}',
'{{ expireTime }}',
'{{ metadata }}',
'{{ ttl }}',
'{{ revisionLabels }}',
'{{ revisionExpireTime }}',
'{{ displayName }}',
'{{ description }}',
{{ disableMemoryRevisions }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ memoryBanksId }}',
'{{ memoryId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update a Memory.

UPDATE google.aiplatform.memories
SET
data__revisionTtl = '{{ revisionTtl }}',
data__scope = '{{ scope }}',
data__topics = '{{ topics }}',
data__fact = '{{ fact }}',
data__name = '{{ name }}',
data__expireTime = '{{ expireTime }}',
data__metadata = '{{ metadata }}',
data__ttl = '{{ ttl }}',
data__revisionLabels = '{{ revisionLabels }}',
data__revisionExpireTime = '{{ revisionExpireTime }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__disableMemoryRevisions = {{ disableMemoryRevisions }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND memoryBanksId = '{{ memoryBanksId }}' --required
AND memoriesId = '{{ memoriesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Delete a Memory.

DELETE FROM google.aiplatform.memories
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND memoryBanksId = '{{ memoryBanksId }}' --required
AND memoriesId = '{{ memoriesId }}' --required
;

Lifecycle Methods

Purge memories.

EXEC google.aiplatform.memories.purge
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@memoryBanksId='{{ memoryBanksId }}' --required
@@json=
'{
"filter": "{{ filter }}",
"force": {{ force }},
"filterGroups": "{{ filterGroups }}"
}'
;