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
Copy file name to clipboardExpand all lines: agentscope-extensions/agentscope-extensions-mem0/src/main/java/io/agentscope/core/memory/mem0/Mem0Client.java
+14-16Lines changed: 14 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -227,41 +227,39 @@ public Mono<Mem0AddResponse> add(Mem0AddRequest request) {
227
227
* memories relevant to the query string. Results are ordered by relevance score
228
228
* (highest first).
229
229
*
230
-
* <p>The v2 API returns a direct array of results, which this method wraps
231
-
* into a Mem0SearchResponse object for consistency with the existing API.
230
+
* <p>Automatically compatible with two Mem0 API response formats:
231
+
* <ul>
232
+
* <li><b>format v1.1</b> — response is a JSON object with a {@code results} field
233
+
* (e.g. {@code {"results": [...]}}), deserialized directly into
234
+
* {@link Mem0SearchResponse}.</li>
235
+
* <li><b>format v1.0</b> — response is a direct JSON array (e.g. {@code [...]}),
236
+
* parsed as a list of results and wrapped into a {@link Mem0SearchResponse}.</li>
237
+
* </ul>
232
238
*
233
239
* <p>The metadata filters (agent_id, user_id, run_id) in the request ensure
234
240
* that only memories from the specified context are returned.
235
241
*
236
-
* <p>The operation is performed asynchronously on the bounded elastic scheduler
237
-
* to avoid blocking the caller thread.
238
-
*
239
242
* @param request The search request containing query and filters
240
243
* @return A Mono emitting the search response with relevant memories
0 commit comments