Class FirestoreMemoryService

java.lang.Object
com.google.adk.memory.FirestoreMemoryService
All Implemented Interfaces:
BaseMemoryService

public class FirestoreMemoryService extends Object implements BaseMemoryService
FirestoreMemoryService is an implementation of BaseMemoryService that uses Firestore to store and retrieve session memory entries.
  • Constructor Details

    • FirestoreMemoryService

      public FirestoreMemoryService(com.google.cloud.firestore.Firestore firestore)
      Constructor for FirestoreMemoryService
  • Method Details

    • addSessionToMemory

      public io.reactivex.rxjava3.core.Completable addSessionToMemory(Session session)
      Adds a session to memory. This is a no-op for FirestoreMemoryService since keywords are indexed when events are appended in FirestoreSessionService.
      Specified by:
      addSessionToMemory in interface BaseMemoryService
      Parameters:
      session - The session to add.
    • searchMemory

      public io.reactivex.rxjava3.core.Single<SearchMemoryResponse> searchMemory(String appName, String userId, String query)
      Searches memory entries for the given appName and userId that match the query keywords.
      Specified by:
      searchMemory in interface BaseMemoryService
      Parameters:
      appName - The name of the application.
      userId - The id of the user.
      query - The query to search for.
      Returns:
      A SearchMemoryResponse containing the matching memories.