BaseFutureMemoryService

Java-friendly base for implementing a MemoryService. The engine's methods are suspend; a Java subclass returns CompletableFutures instead. addEventsToMemoryAsync and addMemoryAsync are optional -- their default throws UnsupportedOperationException (as the engine does), so override them only if the service supports those writes. Return each future promptly and do any blocking work inside it, not before returning it.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
suspend override fun addEventsToMemory(appName: String, userId: String, events: List<Event>, sessionId: String? = null, customMetadata: Map<String, Any?>? = null)

Adds an explicit list of events to the memory service.

Link copied to clipboard
suspend override fun addMemory(appName: String, userId: String, memories: List<MemoryEntry>, customMetadata: Map<String, Any?>? = null)

Adds explicit memory items directly to the memory service.

Link copied to clipboard
suspend override fun addSessionToMemory(session: Session)

Adds a session to the memory service.

Link copied to clipboard
suspend override fun searchMemory(appName: String, userId: String, query: String): SearchMemoryResponse

Searches for sessions that match the query asynchronously.