@aksolab/recall
Version:
A memory management package for AI SDK memory functionality
36 lines • 1.6 kB
TypeScript
import { CoreMessage } from 'ai';
import { MemoryState, CoreBlock, CoreMemoryEntry } from '../../types';
import { StorageProvider } from '../storage-provider';
import { RedisClientType } from 'redis';
export interface RedisProviderConfig {
client: RedisClientType;
prefix?: string;
}
export declare class RedisProvider implements StorageProvider {
private redis;
private prefix;
constructor(config: RedisProviderConfig);
private getKey;
getChatHistoryKey(memoryKey: string, threadId?: string): string;
getCoreMemoryKey(memoryKey: string): string;
flush(): Promise<void>;
export(memoryKey: string, threadId?: string): Promise<MemoryState>;
getMemoryState(memoryKey: string, threadId?: string): Promise<MemoryState | undefined>;
updateChatHistory({ memoryKey, threadId, messages }: {
memoryKey: string;
threadId: string;
messages: CoreMessage[];
}): Promise<void>;
addChatHistoryMessage({ memoryKey, message, threadId }: {
memoryKey: string;
message: CoreMessage;
threadId: string;
}): Promise<void>;
getChatHistory(memoryKey: string, threadId?: string): Promise<CoreMessage[]>;
getCoreMemory(memoryKey: string): Promise<Record<CoreBlock, CoreMemoryEntry> | null>;
updateCoreMemory(key: string, memory: Record<CoreBlock, CoreMemoryEntry> | null): Promise<void>;
initializeMemoryState(memoryKey: string, threadId?: string): Promise<MemoryState>;
deleteMemoryState(memoryKey: string): Promise<void>;
disconnect(): Promise<void>;
}
//# sourceMappingURL=RedisProvider.d.ts.map