Class FirestoreMemoryService
java.lang.Object
com.google.adk.memory.FirestoreMemoryService
- All Implemented Interfaces:
BaseMemoryService
FirestoreMemoryService is an implementation of BaseMemoryService that uses Firestore to store and
retrieve session memory entries.
-
Constructor Summary
ConstructorsConstructorDescriptionFirestoreMemoryService(com.google.cloud.firestore.Firestore firestore) Constructor for FirestoreMemoryService -
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.CompletableaddSessionToMemory(Session session) Adds a session to memory.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.
-
Constructor Details
-
FirestoreMemoryService
public FirestoreMemoryService(com.google.cloud.firestore.Firestore firestore) Constructor for FirestoreMemoryService
-
-
Method Details
-
addSessionToMemory
Adds a session to memory. This is a no-op for FirestoreMemoryService since keywords are indexed when events are appended in FirestoreSessionService.- Specified by:
addSessionToMemoryin interfaceBaseMemoryService- 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:
searchMemoryin interfaceBaseMemoryService- Parameters:
appName- The name of the application.userId- The id of the user.query- The query to search for.- Returns:
- A
SearchMemoryResponsecontaining the matching memories.
-