Files
honeymoose f321dfedf5 同步完成!
**同步结果摘要**:

| 目录 | 同步前 | 同步后 | 官方 |
|------|--------|--------|------|
| aggregations | 40 | 65 | 64 |
| analyzers | 8 | 141 | 140 |
| api-reference | 97 | 186 | 174 |
| benchmark | 34 | 67 | 53 |
| clients | 17 | 18 | 18 |
| dashboards | 38 | 149 | 131 |
| data-prepper | 77 | 134 | 123 |
| im-plugin | 22 | 37 | 37 |
| ingest-pipelines | 27 | 52 | 51 |
| install-and-configure | 37 | 57 | 53 |
| ml-commons-plugin | 81 | 157 | 155 |
| observing-your-data | 39 | 73 | 66 |
| query-dsl | 40 | 77 | 75 |
| search-plugins | 80 | 139 | 95 |
| security-analytics | 22 | 47 | 46 |

**说明**:
- 本地文件数 > 官方:本地有一些官方已删除或重命名的文件
- 新增了约 **740 个英文文档文件**
- 已有文件保持不变(未覆盖)
2026-11-30 10:48:30 -05:00

5.5 KiB

layout, title, parent, grand_parent, nav_order
layout title parent grand_parent nav_order
default Delete agentic memory Agentic memory APIs ML APIs 53

Delete Agentic Memory API

Introduced 3.3 {: .label .label-purple }

Use this API to delete a specific memory by its type and ID or to delete memories matching a query. This unified API supports deleting memories of any memory type: sessions, working, long-term, or history.

Delete a memory by type and ID

Use this API to delete a memory by type and ID.

Endpoints

DELETE /_plugins/_ml/memory_containers/{memory_container_id}/memories/{type}/{id}

Path parameters

The following table lists the available path parameters.

Parameter Data type Required/Optional Description
memory_container_id String Required The ID of the memory container from which to delete the memory.
type String Required The type of memory to delete. Valid values are sessions, working, long-term, and history.
id String Required The ID of the specific memory to delete.

Example request: Delete a working memory

DELETE /_plugins/_ml/memory_containers/HudqiJkB1SltqOcZusVU/memories/working/XyEuiJkBeh2gPPwzjYWM

{% include copy-curl.html %}

Example request: Delete a long-term memory

DELETE /_plugins/_ml/memory_containers/HudqiJkB1SltqOcZusVU/memories/long-term/DcxjTpkBvwXRq366C1Zz

{% include copy-curl.html %}

Example request: Delete a sessions memory

DELETE /_plugins/_ml/memory_containers/HudqiJkB1SltqOcZusVU/memories/sessions/CcxjTpkBvwXRq366A1aE

{% include copy-curl.html %}

Example request: Delete a history memory

DELETE /_plugins/_ml/memory_containers/HudqiJkB1SltqOcZusVU/memories/history/eMxnTpkBvwXRq366hmAU

{% include copy-curl.html %}

Example response

{
  "_index": ".plugins-ml-am-default-memory-working",
  "_id": "XyEuiJkBeh2gPPwzjYWM",
  "_version": 2,
  "result": "deleted",
  "_shards": {
    "total": 1,
    "successful": 1,
    "failed": 0
  },
  "_seq_no": 6,
  "_primary_term": 1
}

Error responses

If you attempt to delete a memory from a container that doesn't exist, OpenSearch returns a 404 Not Found error. OpenSearch also returns a 404 error if the memory doesn't exist. The following response is returned for a container that doesn't exist:

{
  "error": {
    "root_cause": [
      {
        "type": "status_exception",
        "reason": "Memory container not found"
      }
    ],
    "type": "status_exception",
    "reason": "Memory container not found"
  },
  "status": 404
}

Response fields

The following table lists all response body fields.

Field Data type Description
_index String The name of the index from which the memory was deleted.
result String The result of the delete operation.
_id String The ID of the deleted memory.
_version Integer The version number after deletion.
_shards Object Information about the shards involved in the operation.
_seq_no Long The sequence number assigned to the delete operation.
_primary_term Long The primary term of the index.

Delete memories by query

Use this API to delete multiple memories using a query to match specific criteria.

Endpoints

POST /_plugins/_ml/memory_containers/{memory_container_id}/memories/{type}/_delete_by_query

Path parameters

Field Data type Required/Optional Description
memory_container_id String Required The ID of the memory container from which to delete the memory.
type String Required The type of memory to delete. Valid values are sessions, working, long-term, and history.

Request body fields

The request body must contain a query to match the memories you want to delete.

Example request

POST /_plugins/_ml/memory_containers/HudqiJkB1SltqOcZusVU/memories/working/_delete_by_query
{
  "query": {
    "match": {
      "owner_id": "admin"
    }
  }
}

{% include copy-curl.html %}

Example response

{
    "took": 159,
    "timed_out": false,
    "total": 6,
    "updated": 0,
    "created": 0,
    "deleted": 6,
    "batches": 1,
    "version_conflicts": 0,
    "noops": 0,
    "retries": {
        "bulk": 0,
        "search": 0
    },
    "throttled_millis": 0,
    "requests_per_second": -1.0,
    "throttled_until_millis": 0,
    "failures": []
}

Response fields

Field Data type Description
took Integer The time, in milliseconds, taken to execute the request.
timed_out Boolean Whether the request timed out.
total Integer The total number of documents processed.
deleted Integer The number of documents deleted.
batches Integer The number of batches processed.
version_conflicts Integer The number of version conflicts encountered.
noops Integer The number of no-operation updates.
retries Object Information about bulk and search retries.
throttled_millis Integer The time, in milliseconds, that the request was throttled.
requests_per_second Float The number of requests processed per second.
throttled_until_millis Integer The time, in milliseconds, until throttling is lifted.
failures Array Any failures that occurred during the operation.