Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.openmemind.ai.client.model.response.AddMessageResponse;
import com.openmemind.ai.client.model.response.ExtractMemoryResponse;
import com.openmemind.ai.client.model.response.HealthResponse;
import com.openmemind.ai.client.model.response.OperationAccepted;
import com.openmemind.ai.client.model.response.QueryMemoryItemsResponse;
import com.openmemind.ai.client.model.response.QueryMemoryRawDataResponse;
import com.openmemind.ai.client.model.response.RetrieveMemoryResponse;
Expand Down Expand Up @@ -134,6 +135,40 @@ public CompletableFuture<QueryMemoryRawDataResponse> queryRawDataAsync(
new TypeReference<ApiResult<QueryMemoryRawDataResponse>>() {});
}

/**
* Fire-and-forget: submits a message to the async pipeline
* ({@code POST /open/v1/memory/async/add-message}).
*
* <p>The server buffers the message and returns 202 immediately; extraction is
* triggered asynchronously by the server's boundary detector. Unlike
* {@link #addMessageAsync(AddMessageRequest)}, this does not block waiting for the
* synchronous extraction path.
*/
public CompletableFuture<Void> submitMessageAsync(AddMessageRequest request) {
ensureOpen();
return httpClient.post(
"/open/v1/memory/async/add-message",
Objects.requireNonNull(request, "request"),
new TypeReference<ApiResult<OperationAccepted>>() {})
.thenApply(ignored -> null);
}

/**
* Fire-and-forget: submits a commit to the async pipeline
* ({@code POST /open/v1/memory/async/commit}).
*
* <p>Returns 202 immediately; extraction runs asynchronously server-side. Use this to
* avoid blocking on long LLM-driven extraction (the sync commit can exceed HTTP timeouts).
*/
public CompletableFuture<Void> submitCommitAsync(CommitMemoryRequest request) {
ensureOpen();
return httpClient.post(
"/open/v1/memory/async/commit",
Objects.requireNonNull(request, "request"),
new TypeReference<ApiResult<OperationAccepted>>() {})
.thenApply(ignored -> null);
}

public CompletableFuture<HealthResponse> healthAsync() {
ensureOpen();
return httpClient.get("/open/v1/health", new TypeReference<ApiResult<HealthResponse>>() {});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.openmemind.ai.client.model.response;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/** Response payload of the async /open/v1/memory/async/* endpoints (HTTP 202). */
@JsonIgnoreProperties(ignoreUnknown = true)
public record OperationAccepted(String operationId, String status, String mode) {}
Loading