Memory API reference (legacy)
This page is the REST API reference for the legacy managed agent memory, which will be turned down soon. Don't build new agents on it. For long-term agent memory, use Managed agent memory.
This page covers the endpoints, request fields, and response fields for the legacy managed memory:
- A memory store is a Unity Catalog securable that acts as a container for memory entries. Use the Memory store APIs to create and manage stores.
- A memory entry is an individual piece of content stored inside a memory store. Use the Memory entry APIs to read and write entries.
- A conversation is OpenAI-compatible conversation state — messages and tool calls — backed by a memory store and pinned to a scope. Use the Conversation APIs to create and manage conversations and their items.
Prerequisites
Generate an OAuth token using the Databricks CLI to call the APIs:
databricks auth login --host ${DATABRICKS_HOST}
databricks auth token
Memory store APIs
A memory store is a Unity Catalog securable that acts as a container for memory entries. Memory stores use three-level naming: catalog.schema.memory_store_name.
Operation | Endpoint | Required privilege |
|---|---|---|
|
| |
|
| |
|
| |
|
| |
|
|
Create a memory store
Creates a new memory store under a parent schema.
- Endpoint:
POST /api/2.1/unity-catalog/memory-stores - Required privilege:
CREATE MEMORY STOREon the parent schema
curl -X POST "https://${DATABRICKS_HOST}/api/2.1/unity-catalog/memory-stores" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "agent_memory",
"catalog_name": "main",
"schema_name": "default",
"description": "Memory store for customer support agents"
}'
Request fields:
Field | Type | Required | Description |
|---|---|---|---|
|
| Yes | Short name for the memory store. Must match |
|
| Yes | Name of the parent catalog. |
|
| Yes | Name of the parent schema, relative to the catalog. |
|
| No | Human-readable description of the memory store. |
Get a memory store
Retrieves a memory store by its three-part fully qualified name.
- Endpoint:
GET /api/2.1/unity-catalog/memory-stores/{full_name} - Required privilege:
READ MEMORY STOREon the store
curl -X GET \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/memory-stores/main.default.agent_memory" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}"
List memory stores
Lists memory stores in a schema. Results are filtered to stores the caller can read.
- Endpoint:
GET /api/2.1/unity-catalog/memory-stores - Required privilege:
USE SCHEMAon the parent schema
curl -X GET \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/memory-stores?catalog_name=main&schema_name=default" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}"
Query parameters:
Parameter | Type | Required | Description |
|---|---|---|---|
|
| Yes | Parent catalog name. |
|
| Yes | Parent schema name. |
|
| No | Pagination token from a previous response. |
|
| No | Maximum stores per page. Defaults to 100, max 1000. |
Update a memory store
Updates mutable fields on a memory store. Currently only description is mutable.
- Endpoint:
PATCH /api/2.1/unity-catalog/memory-stores/{full_name} - Required privilege:
MANAGEon the store
curl -X PATCH \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/memory-stores/main.default.agent_memory" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"memory_store": {
"description": "Updated description for the memory store"
},
"update_mask": "description"
}'
Delete a memory store
Deletes a memory store and all of its memory entries.
- Endpoint:
DELETE /api/2.1/unity-catalog/memory-stores/{full_name} - Required privilege:
MANAGEon the store
curl -X DELETE \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/memory-stores/main.default.agent_memory" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}"
Memory store response fields
Field | Type | Description |
|---|---|---|
|
| Short name of the memory store. |
|
| Parent catalog name. |
|
| Parent schema name. |
|
| Human-readable description. |
|
| UC principal that owns the store. Set on create. |
|
| Three-part fully qualified name: |
|
| Server-assigned UUID. |
|
| Always |
|
| Creation time in Unix epoch milliseconds. |
|
| Last update time in Unix epoch milliseconds. |
|
| Principal that created the store. |
Memory entry APIs
Memory entries are the individual pieces of content stored inside a memory store. Each entry is identified by a scope and a path: scope is a partition key the caller assigns (for example, an end-user ID), and path is a soft path within that scope that must start with /memories/ (for example, /memories/preferences.md). scope is required on every memory entry request.
Operation | Endpoint | Required privilege |
|---|---|---|
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
Create a memory entry
Creates a new memory entry in a memory store.
- Endpoint:
POST /api/2.1/unity-catalog/memory-stores/{full_name}/entries?scope=<scope> - Required privilege:
WRITE MEMORY STOREon the store
scope is a query parameter; the request body is the entry itself.
curl -X POST \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/memory-stores/main.default.agent_memory/entries?scope=user-42" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"path": "/memories/preferences.md",
"contents": "The user prefers responses in English and uses formal tone.",
"description": "User language and tone preferences"
}'
Request fields:
Field | In | Type | Required | Description |
|---|---|---|---|---|
| query |
| Yes | Partition the entry belongs to, assigned by the caller (for example, an end-user ID). |
| body |
| Yes | Soft path identifying the entry within the scope. Must start with |
| body |
| No | Free-form memory text content. |
| body |
| No | One-line summary of the memory entry. Serves as an index hook in list responses. |
Get a memory entry
Retrieves a single memory entry by scope and path.
- Endpoint:
GET /api/2.1/unity-catalog/memory-stores/{full_name}/entries:get - Required privilege:
READ MEMORY STOREon the store
curl -X GET \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/memory-stores/main.default.agent_memory/entries:get?scope=user-42&path=/memories/preferences.md" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}"
List memory entries
Lists memory entries in a scope.
- Endpoint:
GET /api/2.1/unity-catalog/memory-stores/{full_name}/entries - Required privilege:
READ MEMORY STOREon the store
curl -X GET \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/memory-stores/main.default.agent_memory/entries?scope=user-42" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}"
Query parameters:
Parameter | Type | Required | Description |
|---|---|---|---|
|
| Yes | Scope (partition) to list entries from. |
|
| No | Return only entries whose path starts with this prefix. |
|
| No | Maximum entries per page. The server caps the page size. |
|
| No | Pagination token from a previous response. |
List responses omit contents (metadata only) and include a next_page_token when more pages remain.
Update a memory entry
Applies a single edit operation to an existing entry's contents, identified by scope and path. Provide exactly one of str_replace, insert, or replace_all. description is editable: set it to replace the entry's description, or omit it to leave the description unchanged.
- Endpoint:
PATCH /api/2.1/unity-catalog/memory-stores/{full_name}/entries - Required privilege:
WRITE MEMORY STOREon the store
curl -X PATCH \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/memory-stores/main.default.agent_memory/entries" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"scope": "user-42",
"path": "/memories/preferences.md",
"replace_all": { "contents": "The user prefers responses in Spanish and uses casual tone." }
}'
Edit operations (set exactly one):
Operation | Fields | Behavior |
|---|---|---|
|
| Overwrite the entry's full contents. |
|
| Replace the single occurrence of |
|
| Insert |
Delete a memory entry
Deletes a memory entry, identified by scope and path.
- Endpoint:
DELETE /api/2.1/unity-catalog/memory-stores/{full_name}/entries - Required privilege:
WRITE MEMORY STOREon the store
curl -X DELETE \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/memory-stores/main.default.agent_memory/entries?scope=user-42&path=/memories/preferences.md" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}"
Search memory entries
Searches memory entries by keyword across path, content, and description fields.
- Endpoint:
POST /api/2.1/unity-catalog/memory-stores/{full_name}/entries:search - Required privilege:
READ MEMORY STOREon the store
curl -X POST \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/memory-stores/main.default.agent_memory/entries:search" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"scope": "user-42",
"query": "language preferences"
}'
Request fields: scope (required), query (required), path_prefix (optional), top_k (optional; defaults to 10, max 50).
Memory entry response fields
Field | Type | Description |
|---|---|---|
|
| Soft path of the entry within its scope. |
|
| Memory text. Omitted in List responses. |
|
| One-line summary. |
|
| Scope (partition) the entry belongs to. |
|
| Three-part name of the parent memory store. |
|
| Whether the entry has non-empty |
|
| Creation timestamp (RFC 3339). |
|
| Last update timestamp (RFC 3339). |
Conversation APIs
A conversation stores OpenAI-compatible conversation state — messages, tool calls, and other items — in a memory store under a single scope. With a conversation, an agent persists and reloads session state server-side. You create each conversation against a memory store (three-part name) and a scope, and conversation operations require the same privileges as the underlying memory store.
Operation | Endpoint | Required privilege |
|---|---|---|
|
| |
|
| |
|
| |
|
|
Create a conversation
Creates a conversation bound to a memory store and scope.
- Endpoint:
POST /api/2.1/unity-catalog/conversations - Required privilege:
WRITE MEMORY STOREon the store
curl -X POST "https://${DATABRICKS_HOST}/api/2.1/unity-catalog/conversations" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"memory_store": { "name": "main.default.support_agent_memory" },
"scope": { "kind": "user", "value": "user-123" },
"metadata": { "source": "support-chat" }
}'
Request fields:
Field | Type | Required | Description |
|---|---|---|---|
|
| Yes | Memory store backing the conversation. |
|
| Yes | Three-part fully qualified name of the memory store: |
|
| Yes | Scope the conversation is pinned to. |
|
| Yes | Scope kind, for example |
|
| Yes | Kind-specific scope value, for example an end-user ID. |
|
| No | Caller-controlled key-value metadata. Up to 16 keys; keys up to 64 characters, values up to 512 characters. |
|
| No | Initial OpenAI conversation items to seed the conversation (up to 20). Items without a |
Get a conversation
Retrieves a conversation by its ID.
- Endpoint:
GET /api/2.1/unity-catalog/conversations/{conversation_id} - Required privilege:
READ MEMORY STOREon the store
curl -X GET \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/conversations/${CONVERSATION_ID}" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}"
Update a conversation
Updates a conversation's metadata.
- Endpoint:
POST /api/2.1/unity-catalog/conversations/{conversation_id} - Required privilege:
WRITE MEMORY STOREon the store
curl -X POST \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/conversations/${CONVERSATION_ID}" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{ "metadata": { "source": "support-chat", "resolved": "true" } }'
Delete a conversation
Deletes a conversation and its items.
- Endpoint:
DELETE /api/2.1/unity-catalog/conversations/{conversation_id} - Required privilege:
WRITE MEMORY STOREon the store
curl -X DELETE \
"https://${DATABRICKS_HOST}/api/2.1/unity-catalog/conversations/${CONVERSATION_ID}" \
-H "Authorization: Bearer ${DATABRICKS_TOKEN}"
Conversation response fields
Field | Type | Description |
|---|---|---|
|
| Server-assigned conversation ID. |
|
| Always |
|
| Creation time in Unix epoch seconds. |
|
| Caller-supplied key-value metadata. |
Conversation item APIs
Items are the individual messages and tool calls within a conversation. They follow the OpenAI conversation items shape and use OpenAI-compatible pagination (after, limit, has_more).
Operation | Endpoint | Required privilege |
|---|---|---|
Create items |
|
|
Get item |
|
|
List items |
|
|
Delete item |
|
|