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

2.7 KiB

layout, title, parent, grand_parent, nav_order
layout title parent grand_parent nav_order
default Create session Agentic memory APIs ML APIs 40

Create Session API

Introduced 3.3 {: .label .label-purple }

Use this API to create a new session in a memory container. Sessions represent distinct interaction contexts between users and agents.

Endpoints

POST /_plugins/_ml/memory_containers/{memory_container_id}/memories/sessions

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 where the session will be created.

Request fields

The following table lists the available request body fields.

Field Data type Required/Optional Description
session_id String Optional A custom session ID. If provided, this ID is used for the session. If not provided, a random ID is generated.
summary String Optional A session summary or description.
metadata Object Optional Additional metadata for the session provided as key-value pairs.
namespace Object Optional Namespace information for organizing the session.
agents Object Optional Information about the agents that participate in the session, provided as key-value pairs.
additional_info Object Optional Additional information about the session, provided as key-value pairs.

Example request: Create a session with a custom ID

POST /_plugins/_ml/memory_containers/SdjmmpgBOh0h20Y9kWuN/memories/sessions
{
  "session_id": "abc123",
  "metadata": {
    "key1": "value1"
  }
}

{% include copy-curl.html %}

Example response: Custom session ID

{
  "session_id": "abc123",
  "status": "created"
}

Example request: Create a session with an autogenerated ID

POST /_plugins/_ml/memory_containers/SdjmmpgBOh0h20Y9kWuN/memories/sessions
{
  "summary": "This is a test session",
  "metadata": {
    "key1": "value1"
  },
  "namespace": {
    "user_id": "bob"
  }
}

{% include copy-curl.html %}

Example response: Autogenerated session ID

{
  "session_id": "jTYm35kBt8CyICnjxJl9",
  "status": "created"
}

Response fields

The following table lists all response body fields.

Field Data type Description
session_id String The ID of the created session (either provided or auto-generated).
status String The status of the creation operation. Returned values are created if a new session was created or exists if a session with the specified session_id already exists.