Class InMemoryMemoryService
java.lang.Object
com.google.adk.memory.InMemoryMemoryService
- All Implemented Interfaces:
BaseMemoryService
An in-memory memory service for prototyping purposes only.
Uses keyword matching instead of semantic search.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Completable
addSessionToMemory
(Session session) Adds a session to the memory service.io.reactivex.rxjava3.core.Single
<SearchMemoryResponse> searchMemory
(String appName, String userId, String query) Searches for sessions that match the query asynchronously.
-
Constructor Details
-
InMemoryMemoryService
public InMemoryMemoryService()
-
-
Method Details
-
addSessionToMemory
Description copied from interface:BaseMemoryService
Adds a session to the memory service.A session may be added multiple times during its lifetime.
- Specified by:
addSessionToMemory
in interfaceBaseMemoryService
- Parameters:
session
- The session to add.
-
searchMemory
public io.reactivex.rxjava3.core.Single<SearchMemoryResponse> searchMemory(String appName, String userId, String query) Description copied from interface:BaseMemoryService
Searches for sessions that match the query asynchronously.- Specified by:
searchMemory
in interfaceBaseMemoryService
- 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.
-