memories
Creates, updates, deletes, gets or lists a memories resource.
Overview
| Name | memories |
| Type | Resource |
| Id | google.aiplatform.memories |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. Represents the resource name of the Memory. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory} |
createTime | string (google-datetime) | Output only. Represents the timestamp when this Memory was created. |
description | string | Optional. Represents the description of the Memory. |
disableMemoryRevisions | boolean | Optional. Input only. Indicates whether no revision will be created for this request. |
displayName | string | Optional. Represents the display name of the Memory. |
expireTime | string (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. |
fact | string | Optional. Represents semantic knowledge extracted from the source content. |
metadata | object | Optional. 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. |
revisionExpireTime | string (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. |
revisionLabels | object | Optional. Input only. Represents the labels to apply to the Memory Revision created as a result of this request. |
revisionTtl | string (google-duration) | Optional. Input only. Represents the TTL for the revision. The expiration time is computed: now + TTL. |
scope | object | Required. 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 '*'. |
topics | array | Optional. Represents the Topics of the Memory. |
ttl | string (google-duration) | Optional. Input only. Represents the TTL for this resource. The expiration time is computed: now + TTL. |
updateTime | string (google-datetime) | Output only. Represents the timestamp when this Memory was most recently updated. |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. Represents the resource name of the Memory. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory} |
createTime | string (google-datetime) | Output only. Represents the timestamp when this Memory was created. |
description | string | Optional. Represents the description of the Memory. |
disableMemoryRevisions | boolean | Optional. Input only. Indicates whether no revision will be created for this request. |
displayName | string | Optional. Represents the display name of the Memory. |
expireTime | string (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. |
fact | string | Optional. Represents semantic knowledge extracted from the source content. |
metadata | object | Optional. 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. |
revisionExpireTime | string (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. |
revisionLabels | object | Optional. Input only. Represents the labels to apply to the Memory Revision created as a result of this request. |
revisionTtl | string (google-duration) | Optional. Input only. Represents the TTL for the revision. The expiration time is computed: now + TTL. |
scope | object | Required. 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 '*'. |
topics | array | Optional. Represents the Topics of the Memory. |
ttl | string (google-duration) | Optional. Input only. Represents the TTL for this resource. The expiration time is computed: now + TTL. |
updateTime | string (google-datetime) | Output only. Represents the timestamp when this Memory was most recently updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, memoryBanksId, memoriesId | Get a Memory. | |
list | select | projectsId, locationsId, memoryBanksId | pageSize, filter, pageToken, orderBy | List Memories. |
create | insert | projectsId, locationsId, memoryBanksId | memoryId | Create a Memory. |
patch | update | projectsId, locationsId, memoryBanksId, memoriesId | updateMask | Update a Memory. |
delete | delete | projectsId, locationsId, memoryBanksId, memoriesId | Delete a Memory. | |
purge | exec | projectsId, locationsId, memoryBanksId | Purge memories. | |
ingest_events | exec | projectsId, locationsId, reasoningEnginesId | Ingests events for a Memory Bank. | |
retrieve | exec | projectsId, locationsId, memoryBanksId | Retrieve memories. | |
rollback | exec | projectsId, locationsId, memoryBanksId, memoriesId | Rollback Memory to a specific revision. | |
generate | exec | projectsId, locationsId, memoryBanksId | Generate 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.
| Name | Datatype | Description |
|---|---|---|
locationsId | string | |
memoriesId | string | |
memoryBanksId | string | |
projectsId | string | |
reasoningEnginesId | string | |
filter | string | |
memoryId | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- list
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
;
List Memories.
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 pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: memories
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the memories resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the memories resource.
- name: memoryBanksId
value: "{{ memoryBanksId }}"
description: Required parameter for the memories resource.
- name: revisionTtl
value: "{{ revisionTtl }}"
description: |
Optional. Input only. Represents the TTL for the revision. The expiration time is computed: now + TTL.
- name: scope
value: "{{ scope }}"
description: |
Required. 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 '*'.
- name: topics
description: |
Optional. Represents the Topics of the Memory.
value:
- managedMemoryTopic: "{{ managedMemoryTopic }}"
customMemoryTopicLabel: "{{ customMemoryTopicLabel }}"
- name: fact
value: "{{ fact }}"
description: |
Optional. Represents semantic knowledge extracted from the source content.
- name: name
value: "{{ name }}"
description: |
Identifier. Represents the resource name of the Memory. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}`
- name: expireTime
value: "{{ expireTime }}"
description: |
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.
- name: metadata
value: "{{ metadata }}"
description: |
Optional. 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.
- name: ttl
value: "{{ ttl }}"
description: |
Optional. Input only. Represents the TTL for this resource. The expiration time is computed: now + TTL.
- name: revisionLabels
value: "{{ revisionLabels }}"
description: |
Optional. Input only. Represents the labels to apply to the Memory Revision created as a result of this request.
- name: revisionExpireTime
value: "{{ revisionExpireTime }}"
description: |
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.
- name: displayName
value: "{{ displayName }}"
description: |
Optional. Represents the display name of the Memory.
- name: description
value: "{{ description }}"
description: |
Optional. Represents the description of the Memory.
- name: disableMemoryRevisions
value: {{ disableMemoryRevisions }}
description: |
Optional. Input only. Indicates whether no revision will be created for this request.
- name: memoryId
value: "{{ memoryId }}"
UPDATE examples
- patch
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
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
- ingest_events
- retrieve
- rollback
- generate
Purge memories.
EXEC google.aiplatform.memories.purge
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@memoryBanksId='{{ memoryBanksId }}' --required
@@json=
'{
"filter": "{{ filter }}",
"force": {{ force }},
"filterGroups": "{{ filterGroups }}"
}'
;
Ingests events for a Memory Bank.
EXEC google.aiplatform.memories.ingest_events
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@reasoningEnginesId='{{ reasoningEnginesId }}' --required
@@json=
'{
"streamId": "{{ streamId }}",
"generationTriggerConfig": "{{ generationTriggerConfig }}",
"disableMemoryRevisions": {{ disableMemoryRevisions }},
"metadata": "{{ metadata }}",
"revisionLabels": "{{ revisionLabels }}",
"forceFlush": {{ forceFlush }},
"directContentsSource": "{{ directContentsSource }}",
"metadataMergeStrategy": "{{ metadataMergeStrategy }}",
"revisionExpireTime": "{{ revisionExpireTime }}",
"revisionTtl": "{{ revisionTtl }}",
"scope": "{{ scope }}"
}'
;
Retrieve memories.
EXEC google.aiplatform.memories.retrieve
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@memoryBanksId='{{ memoryBanksId }}' --required
@@json=
'{
"simpleRetrievalParams": "{{ simpleRetrievalParams }}",
"filter": "{{ filter }}",
"memoryTypes": "{{ memoryTypes }}",
"scope": "{{ scope }}",
"similaritySearchParams": "{{ similaritySearchParams }}",
"filterGroups": "{{ filterGroups }}"
}'
;
Rollback Memory to a specific revision.
EXEC google.aiplatform.memories.rollback
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@memoryBanksId='{{ memoryBanksId }}' --required,
@memoriesId='{{ memoriesId }}' --required
@@json=
'{
"targetRevisionId": "{{ targetRevisionId }}"
}'
;
Generate memories.
EXEC google.aiplatform.memories.generate
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@memoryBanksId='{{ memoryBanksId }}' --required
@@json=
'{
"metadata": "{{ metadata }}",
"disableMemoryRevisions": {{ disableMemoryRevisions }},
"vertexSessionSource": "{{ vertexSessionSource }}",
"revisionLabels": "{{ revisionLabels }}",
"allowedTopics": "{{ allowedTopics }}",
"revisionExpireTime": "{{ revisionExpireTime }}",
"revisionTtl": "{{ revisionTtl }}",
"disableConsolidation": {{ disableConsolidation }},
"scope": "{{ scope }}",
"directContentsSource": "{{ directContentsSource }}",
"metadataMergeStrategy": "{{ metadataMergeStrategy }}",
"directMemoriesSource": "{{ directMemoriesSource }}"
}'
;