Class InMemoryMemoryService

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

public final class InMemoryMemoryService extends Object implements BaseMemoryService
An in-memory memory service for prototyping purposes only.

Uses keyword matching instead of semantic search.

  • Constructor Details

    • InMemoryMemoryService

      public InMemoryMemoryService()
  • Method Details

    • addSessionToMemory

      public io.reactivex.rxjava3.core.Completable addSessionToMemory(Session session)
      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 interface BaseMemoryService
      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 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.