UNPKG

adk-typescript

Version:

TypeScript port of Google's Agent Development Kit (ADK)

47 lines (46 loc) 1.73 kB
import { SessionInterface as Session } from '../sessions/types'; import { BaseMemoryService, SearchMemoryResponse } from './BaseMemoryService'; /** * An in-memory memory service for prototyping purpose only. * Uses keyword matching instead of semantic search. */ export declare class InMemoryMemoryService implements BaseMemoryService { private sessionEvents; private memoryStore; /** * Adds a session to the memory service. * @param session The session to add */ addSessionToMemory(session: Session): Promise<void>; /** * Searches for sessions that match the query. * @param appName The name of the application * @param userId The id of the user * @param query The query to search for * @returns A SearchMemoryResponse containing the matching memories */ searchMemory(appName: string, userId: string, query: string): Promise<SearchMemoryResponse>; /** * Stores a memory entry. * @param appName The application name * @param userId The user ID * @param key The memory key * @param value The memory value */ store(appName: string, userId: string, key: string, value: any): Promise<void>; /** * Retrieves a memory entry. * @param appName The application name * @param userId The user ID * @param key The memory key * @returns The memory value, or undefined if not found */ retrieve(appName: string, userId: string, key: string): Promise<any | undefined>; /** * Deletes a memory entry. * @param appName The application name * @param userId The user ID * @param key The memory key */ delete(appName: string, userId: string, key: string): Promise<void>; }