You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add comprehensive agentic memory API documentation for OpenSearch 3.3
- Add long-term memory APIs: search, update, delete
- Add memory history APIs: search, delete
- Add general memory APIs: get, update, delete, search by type
- Update add-memory API to include data type memory and structured data
- Update index with complete API structure
- Support for conversation memory, data memory, and trace data
- Include namespace-based organization and tagging system
- Remove experimental warning as agentic memory is GA in 3.3
This is an experimental feature and is not recommended for use in a production environment. For updates on the progress of the feature or if you want to leave feedback, join the discussion on the [OpenSearch forum](https://forum.opensearch.org/).
14
-
{: .warning}
15
13
16
-
Use this API to add an agentic memory to a [memory container]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/create-memory-container). You can create a memory in one of the following modes (controlled by the `infer` parameter):
14
+
Use this API to add an agentic memory to a [memory container]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/agentic-memory-apis/create-memory-container). You can create memories in two types:
15
+
16
+
-**Conversation memory** -- Stores conversational messages between users and assistants. Can be processed (when `infer` is `true`) to extract facts or stored as raw messages.
17
+
18
+
-**Data memory** -- Stores structured, non-conversational data such as agent state, checkpoints, or reference information.
19
+
20
+
Memory processing modes (controlled by the `infer` parameter):
17
21
18
22
- Fact memory -- A processed representation of the message. The large language model (LLM) associated with the memory container extracts and stores key factual information or knowledge from the original text.
19
23
@@ -33,41 +37,113 @@ The following table lists the available request body fields.
33
37
34
38
Field | Data type | Required/Optional | Description
35
39
:--- | :--- | :--- | :---
36
-
`messages` | List | Required | A list of messages. Each message requires `content` and may include a `role` (commonly, `user` or `assistant`) when `infer` is set to `true`.
37
-
`session_id` | String | Optional | The session ID associated with the memory.
38
-
`agent_id` | String | Optional | The agent ID associated with the memory.
39
-
`infer` | Boolean | Optional | Controls whether the LLM infers context from messages. Default is `true`. When `true`, the LLM extracts factual information from the original text and stores it as the memory. When `false`, the memory contains the unprocessed message and you must explicitly specify the `role` in each message.
40
+
`messages` | List | Conditional | A list of messages for conversation memory. Each message requires `content` and may include a `role` (commonly, `user` or `assistant`) when `infer` is set to `true`. Required for `memory_type` of `conversation`.
41
+
`structured_data` | Object | Conditional | Structured data content for data memory. Required for `memory_type` of `data`.
42
+
`memory_type` | String | Required | The type of memory: `conversation` or `data`.
`session_id` | String | Optional | The session ID associated with the memory. Deprecated in favor of using `namespace.session_id`.
45
+
`agent_id` | String | Optional | The agent ID associated with the memory. Deprecated in favor of using `namespace.agent_id`.
46
+
`infer` | Boolean | Optional | Controls whether the LLM infers context from messages. Default is `true` for conversation memory, `false` for data memory. When `true`, the LLM extracts factual information from the original text and stores it as the memory. When `false`, the memory contains the unprocessed message and you must explicitly specify the `role` in each message.
40
47
`tags` | Object | Optional | Custom metadata for the agentic memory.
41
48
42
-
## Example request
49
+
## Example requests
50
+
51
+
### Conversation memory
43
52
44
53
```json
45
54
POST /_plugins/_ml/memory_containers/SdjmmpgBOh0h20Y9kWuN/memories
46
55
{
47
-
"messages": [
48
-
{"role": "user", "content": "Machine learning is a subset of artificial intelligence"}
49
-
],
50
-
"session_id": "sess_789",
51
-
"agent_id": "agent_123",
52
-
"tags": {
53
-
"topic": "personal info"
56
+
"messages": [
57
+
{
58
+
"role": "user",
59
+
"content": "I'm Bob, I really like swimming."
60
+
},
61
+
{
62
+
"role": "assistant",
63
+
"content": "Cool, nice. Hope you enjoy your life."
54
64
}
65
+
],
66
+
"namespace": {
67
+
"user_id": "bob"
68
+
},
69
+
"tags": {
70
+
"topic": "personal info"
71
+
},
72
+
"infer": true,
73
+
"memory_type": "conversation"
74
+
}
75
+
```
76
+
77
+
### Data memory
78
+
79
+
```json
80
+
POST /_plugins/_ml/memory_containers/SdjmmpgBOh0h20Y9kWuN/memories
81
+
{
82
+
"structured_data": {
83
+
"time_range": {
84
+
"start": "2025-09-11",
85
+
"end": "2025-09-15"
86
+
}
87
+
},
88
+
"namespace": {
89
+
"agent_id": "testAgent1"
90
+
},
91
+
"tags": {
92
+
"topic": "agent_state"
93
+
},
94
+
"infer": false,
95
+
"memory_type": "data"
96
+
}
97
+
```
98
+
99
+
### Trace data memory
100
+
101
+
```json
102
+
POST /_plugins/_ml/memory_containers/SdjmmpgBOh0h20Y9kWuN/memories
103
+
{
104
+
"structured_data": {
105
+
"tool_invocations": [
106
+
{
107
+
"tool_name": "ListIndexTool",
108
+
"tool_input": {
109
+
"filter": "*,-.plugins*"
110
+
},
111
+
"tool_output": "green open security-auditlog-2025.09.17..."
112
+
}
113
+
]
114
+
},
115
+
"namespace": {
116
+
"user_id": "bob",
117
+
"agent_id": "testAgent1",
118
+
"session_id": "123"
119
+
},
120
+
"tags": {
121
+
"topic": "personal info",
122
+
"parent_memory_id": "o4-WWJkBFT7urc7Ed9hM",
123
+
"data_type": "trace"
124
+
},
125
+
"infer": false,
126
+
"memory_type": "conversation"
55
127
}
56
128
```
57
129
{% include copy-curl.html %}
58
130
59
-
## Example response
131
+
## Example responses
132
+
133
+
### Conversation memory response
134
+
135
+
```json
136
+
{
137
+
"session_id": "XSEuiJkBeh2gPPwzjYVh",
138
+
"working_memory_id": "XyEuiJkBeh2gPPwzjYWM"
139
+
}
140
+
```
141
+
142
+
### Data memory response
60
143
61
144
```json
62
145
{
63
-
"results": [
64
-
{
65
-
"id": "T9jtmpgBOh0h20Y91WtZ",
66
-
"text": "Machine learning is a subset of artificial intelligence",
67
-
"event": "ADD"
68
-
}
69
-
],
70
-
"session_id": "sess_789"
146
+
"working_memory_id": "Z8xeTpkBvwXRq366l0iA"
71
147
}
72
148
```
73
149
@@ -77,8 +153,5 @@ The following table lists all response body fields.
|`results`| List | A list of memory entries returned by the request. |
81
-
|`results.id`| String | The unique identifier for the memory entry. |
82
-
|`results.text`| String | If `infer` is `false`, contains the stored text from the message. If `infer` is `true`, contains the extracted fact from the message. |
83
-
|`results.event`| String | The type of event for the memory entry. For the Add Agentic Memory API, the event type is always `ADD`, indicating that the memory was added. |
84
-
|`session_id`| String | The session ID associated with the memory. |
156
+
|`session_id`| String | The session ID associated with the memory (returned for conversation memory when a session is created or used). |
157
+
|`working_memory_id`| String | The unique identifier for the created working memory entry. |
0 commit comments