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. The resource name of the Memory. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}
createTimestring (google-datetime)Output only. Timestamp when this Memory was created.
descriptionstringOptional. Description of the Memory.
disableMemoryRevisionsbooleanOptional. Input only. If true, no revision will be created for this request.
displayNamestringOptional. Display name of the Memory.
expireTimestring (google-datetime)Optional. 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.
factstringRequired. Semantic knowledge extracted from the source content.
revisionExpireTimestring (google-datetime)Optional. Input only. Timestamp of when the revision is considered expired. If not set, the memory revision will be kept until manually deleted.
revisionLabelsobjectOptional. Input only. The labels to apply to the Memory Revision created as a result of this request.
revisionTtlstring (google-duration)Optional. Input only. The TTL for the revision. The expiration time is computed: now + TTL.
scopeobjectRequired. Immutable. 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. The Topics of the Memory.
ttlstring (google-duration)Optional. Input only. The TTL for this resource. The expiration time is computed: now + TTL.
updateTimestring (google-datetime)Output only. Timestamp when this Memory was most recently updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, reasoningEnginesId, memoriesIdGet a Memory.
listselectprojectsId, locationsId, reasoningEnginesIdpageToken, orderBy, pageSize, filterList Memories.
createinsertprojectsId, locationsId, reasoningEnginesIdCreate a Memory.
patchupdateprojectsId, locationsId, reasoningEnginesId, memoriesIdupdateMaskUpdate a Memory.
deletedeleteprojectsId, locationsId, reasoningEnginesId, memoriesIdDelete a Memory.
rollbackexecprojectsId, locationsId, reasoningEnginesId, memoriesIdRollback Memory to a specific revision.
retrieveexecprojectsId, locationsId, reasoningEnginesIdRetrieve memories.
generateexecprojectsId, locationsId, reasoningEnginesIdGenerate memories.
purgeexecprojectsId, locationsId, reasoningEnginesIdPurge 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
projectsIdstring
reasoningEnginesIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Get a Memory.

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

INSERT examples

Create a Memory.

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

UPDATE examples

Update a Memory.

UPDATE google.aiplatform.memories
SET
data__expireTime = '{{ expireTime }}',
data__disableMemoryRevisions = {{ disableMemoryRevisions }},
data__revisionExpireTime = '{{ revisionExpireTime }}',
data__name = '{{ name }}',
data__revisionTtl = '{{ revisionTtl }}',
data__ttl = '{{ ttl }}',
data__fact = '{{ fact }}',
data__displayName = '{{ displayName }}',
data__topics = '{{ topics }}',
data__scope = '{{ scope }}',
data__description = '{{ description }}',
data__revisionLabels = '{{ revisionLabels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND reasoningEnginesId = '{{ reasoningEnginesId }}' --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 reasoningEnginesId = '{{ reasoningEnginesId }}' --required
AND memoriesId = '{{ memoriesId }}' --required
;

Lifecycle Methods

Rollback Memory to a specific revision.

EXEC google.aiplatform.memories.rollback 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@reasoningEnginesId='{{ reasoningEnginesId }}' --required,
@memoriesId='{{ memoriesId }}' --required
@@json=
'{
"targetRevisionId": "{{ targetRevisionId }}"
}'
;