Package io.agentscope.core.memory.reme
Class ReMeClient
java.lang.Object
io.agentscope.core.memory.reme.ReMeClient
HTTP client for interacting with the ReMe API.
-
Constructor Summary
ConstructorsConstructorDescriptionReMeClient(String apiBaseUrl) Creates a new ReMeClient with specified configuration.ReMeClient(String apiBaseUrl, Duration timeout) Creates a new ReMeClient with custom timeout. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<ReMeAddResponse>add(ReMeAddRequest request) Adds memories to ReMe by sending trajectories for processing.reactor.core.publisher.Mono<ReMeSearchResponse>search(ReMeSearchRequest request) Searches memories in ReMe using the provided query.voidshutdown()Shuts down the HTTP client and releases resources.
-
Constructor Details
-
ReMeClient
Creates a new ReMeClient with specified configuration.- Parameters:
apiBaseUrl- The base URL of the ReMe API (e.g., "http://localhost:8002")
-
ReMeClient
Creates a new ReMeClient with custom timeout.- Parameters:
apiBaseUrl- The base URL of the ReMe APItimeout- HTTP request timeout duration
-
-
Method Details
-
add
Adds memories to ReMe by sending trajectories for processing.This method calls the
POST /summary_personal_memoryendpoint. ReMe will process the trajectories and extract memorable information.The operation is performed asynchronously on the bounded elastic scheduler to avoid blocking the caller thread.
- Parameters:
request- The add request containing trajectories and workspace ID- Returns:
- A Mono emitting the response
-
search
Searches memories in ReMe using the provided query.This method calls the
POST /retrieve_personal_memoryendpoint to find memories relevant to the query string.The operation is performed asynchronously on the bounded elastic scheduler to avoid blocking the caller thread.
- Parameters:
request- The search request containing query, workspace ID, and topK- Returns:
- A Mono emitting the search response with relevant memories
-
shutdown
public void shutdown()Shuts down the HTTP client and releases resources.This method should be called when the client is no longer needed. After calling this method, the client should not be used for further requests.
-