# 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 Summary

  Constructors
  Constructor
  Description
  `InMemoryMemoryService()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `io.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.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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.