Class ReMeClient

java.lang.Object
io.agentscope.core.memory.reme.ReMeClient

public class ReMeClient extends Object
HTTP client for interacting with the ReMe API.
  • Constructor Details

    • ReMeClient

      public ReMeClient(String apiBaseUrl)
      Creates a new ReMeClient with specified configuration.
      Parameters:
      apiBaseUrl - The base URL of the ReMe API (e.g., "http://localhost:8002")
    • ReMeClient

      public ReMeClient(String apiBaseUrl, Duration timeout)
      Creates a new ReMeClient with custom timeout.
      Parameters:
      apiBaseUrl - The base URL of the ReMe API
      timeout - HTTP request timeout duration
  • Method Details

    • add

      public reactor.core.publisher.Mono<ReMeAddResponse> add(ReMeAddRequest request)
      Adds memories to ReMe by sending trajectories for processing.

      This method calls the POST /summary_personal_memory endpoint. 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

      public reactor.core.publisher.Mono<ReMeSearchResponse> search(ReMeSearchRequest request)
      Searches memories in ReMe using the provided query.

      This method calls the POST /retrieve_personal_memory endpoint 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.