Skip to main content

memories

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

Overview​

Namememories
TypeResource
Iddatabricks_workspace.agentkit.memories

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringResource name in the form ``memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}``. Required for updates; assigned by the service on creation.
actor_idstringCustomer-provided identifier for the actor whose memory this entry represents.
session_idstringOptional identifier for the session associated with this memory entry. When omitted, the entry applies across the actor's sessions.
contentstringOptional free-form memory content.
create_timestring (date-time)Time when the entry was created.
descriptionstringHuman-readable description of the memory entry.
pathstringAbsolute, case-sensitive path identifying the entry within its actor and optional session. Paths must begin with ``/`` and must not contain empty, ``.`` or ``..`` segments.
source_typestringWhich writer created this entry. Caller sets this on Create; immutable after creation. (MANAGED_MEMORY_ENTRY_SOURCE_TYPE_AGENT, MANAGED_MEMORY_ENTRY_SOURCE_TYPE_DREAMER)
update_timestring (date-time)Time when the entry was last updated.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectmanaged_memory_store_id, managed_memory_entry_id, deployment_name, workspace_domainviewRetrieves a memory entry by resource name. view controls whether the response includes memory
listselectmanaged_memory_store_id, actor_id, deployment_name, workspace_domainpage_size, page_token, path_prefix, session_id, viewLists memory entries for one actor. An exact path filters entries across sessions, ignoring
createinsertmanaged_memory_store_id, deployment_name, workspace_domain, actor_id, pathmanaged_memory_entry_idCreates a memory entry using exclusive-create semantics. Callers may choose the entry ID; the service
updateupdatemanaged_memory_store_id, managed_memory_entry_id, update_mask, deployment_name, workspace_domain, actor_id, pathUpdates selected mutable fields on a memory entry. Identity fields are immutable.
deletedeletemanaged_memory_store_id, managed_memory_entry_id, deployment_name, workspace_domainDeletes a memory entry by resource name. Returns NOT_FOUND when the entry does not exist in the
searchexecmanaged_memory_store_id, deployment_name, workspace_domain, actor_id, querySearches memory entries by text query for one actor. Returns matching entries and scores ranked by

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
actor_idstringCustomer-provided identifier for the actor whose entries are listed.
deployment_namestringThe Databricks workspace deployment name: the host prefix of the workspace URL (dbc-abcd0123-a1bc on AWS, adb-1234567890123456.7 on Azure, 1234567890123456.7 on GCP). Set DATABRICKS_DEPLOYMENT_NAME to default it for the session. (default: dbc-abcd0123-a1bc, x-stackQL-envVar: DATABRICKS_DEPLOYMENT_NAME)
managed_memory_entry_idstringThe managed_memory_entry_id segment of the name resource name (memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}). Resource name in the form memory-stores/{managed_memory_store_id}/entries/{managed_memory_entry_id}.
managed_memory_store_idstringThe managed_memory_store_id segment of the parent resource name (memory-stores/{managed_memory_store_id}). Memory store whose entries are searched, in the form memory-stores/{managed_memory_store_id}.
update_maskobjectFields to update. Only content and description may be updated.
workspace_domainstringThe Databricks workspace domain suffix for the cloud. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws). (default: cloud.databricks.com, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"cloud.databricks.com","azure":"azuredatabricks.net","gcp":"gcp.databricks.com"}})
managed_memory_entry_idstringOptional caller-selected memory entry ID. The service generates an ID when omitted.
page_sizeintegerMaximum number of entries to return. The service may return fewer entries than requested. Defaults to 10; must be between 1 and 100.
page_tokenstringOpaque pagination token from a previous ListManagedMemoryEntries response.
path_prefixstringOptional path prefix used to restrict entries within the actor partition.
session_idstringOptional session identifier. When set, only entries with this exact session_id are returned. Omitted-session (cross-session) entries are not included. Ignored when path is set.
viewstringControls whether each returned entry includes memory content. Defaults to FULL.

SELECT examples​

Retrieves a memory entry by resource name. view controls whether the response includes memory

SELECT
name,
actor_id,
session_id,
content,
create_time,
description,
path,
source_type,
update_time
FROM databricks_workspace.agentkit.memories
WHERE managed_memory_store_id = '{{ managed_memory_store_id }}' -- required
AND managed_memory_entry_id = '{{ managed_memory_entry_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND workspace_domain = '{{ workspace_domain }}' -- required
AND view = '{{ view }}'
;

INSERT examples​

Creates a memory entry using exclusive-create semantics. Callers may choose the entry ID; the service

INSERT INTO databricks_workspace.agentkit.memories (
actor_id,
path,
content,
create_time,
description,
name,
session_id,
source_type,
update_time,
managed_memory_store_id,
deployment_name,
workspace_domain,
managed_memory_entry_id
)
SELECT
'{{ actor_id }}' /* required */,
'{{ path }}' /* required */,
'{{ content }}',
'{{ create_time }}',
'{{ description }}',
'{{ name }}',
'{{ session_id }}',
'{{ source_type }}',
'{{ update_time }}',
'{{ managed_memory_store_id }}',
'{{ deployment_name }}',
'{{ workspace_domain }}',
'{{ managed_memory_entry_id }}'
RETURNING
name,
actor_id,
session_id,
content,
create_time,
description,
path,
source_type,
update_time
;

UPDATE examples​

Updates selected mutable fields on a memory entry. Identity fields are immutable.

UPDATE databricks_workspace.agentkit.memories
SET
actor_id = '{{ actor_id }}',
path = '{{ path }}',
content = '{{ content }}',
create_time = '{{ create_time }}',
description = '{{ description }}',
name = '{{ name }}',
session_id = '{{ session_id }}',
source_type = '{{ source_type }}',
update_time = '{{ update_time }}'
WHERE
managed_memory_store_id = '{{ managed_memory_store_id }}' --required
AND managed_memory_entry_id = '{{ managed_memory_entry_id }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND workspace_domain = '{{ workspace_domain }}' --required
AND actor_id = '{{ actor_id }}' --required
AND path = '{{ path }}' --required
RETURNING
name,
actor_id,
session_id,
content,
create_time,
description,
path,
source_type,
update_time;

DELETE examples​

Deletes a memory entry by resource name. Returns NOT_FOUND when the entry does not exist in the

DELETE FROM databricks_workspace.agentkit.memories
WHERE managed_memory_store_id = '{{ managed_memory_store_id }}' --required
AND managed_memory_entry_id = '{{ managed_memory_entry_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND workspace_domain = '{{ workspace_domain }}' --required
;

Lifecycle Methods​

Searches memory entries by text query for one actor. Returns matching entries and scores ranked by

EXEC databricks_workspace.agentkit.memories.search
@managed_memory_store_id='{{ managed_memory_store_id }}' --required,
@deployment_name='{{ deployment_name }}' --required,
@workspace_domain='{{ workspace_domain }}' --required
@@json=
'{
"actor_id": "{{ actor_id }}",
"query": "{{ query }}",
"limit": {{ limit }},
"page_size": {{ page_size }},
"page_token": "{{ page_token }}",
"path_prefix": "{{ path_prefix }}",
"session_id": "{{ session_id }}",
"view": "{{ view }}"
}'
;