/**** * Redis Memory Backend * * Distributed memory implementation using Redis for multi-process deployments. * Enables conversation persistence across server restarts and horizontal scaling. */ import { type Memory, type MemoryConfigBase, type MemoryStats, type MinimalMessage } from "./memory-interface.js"; /** * Redis client interface (compatible with ioredis and node-redis) */ export interface RedisEvalOptions { keys: string[]; arguments: string[]; } export interface RedisClient { get(key: string): Promise; set(key: string, value: string, options?: { EX?: number; }): Promise; del(key: string): Promise; expire(key: string, seconds: number): Promise; eval?(script: string, options: RedisEvalOptions): Promise; sendCommand?(args: string[]): Promise; call?(command: string, ...args: string[]): Promise; } /** * Redis memory configuration */ export interface RedisMemoryConfig extends MemoryConfigBase { type: "redis"; /** Redis client instance */ client: RedisClient; /** Key prefix for namespacing */ keyPrefix?: string; /** User ID for per-user memory isolation */ userId?: string; /** TTL in seconds (default: 24 hours) */ ttl?: number; } /** Implement redis memory. */ export declare class RedisMemory implements Memory { private client; private agentId; private userId; private keyPrefix; private ttl; private config; constructor(agentId: string, config: RedisMemoryConfig); private getKey; private parseMessages; add(message: M): Promise; getMessages(): Promise; clear(): Promise; getStats(): Promise; touch(): Promise; private atomicAdd; } /** Create redis memory. */ export declare function createRedisMemory(agentId: string, config: RedisMemoryConfig): RedisMemory; //# sourceMappingURL=redis.d.ts.map