/** * PostgreSQL Memory Store with pgvector * * Cloud-native memory backend for Railway deployments. * Uses pgvector extension for efficient vector similarity search. * * Features: * - All AdvancedMemoryStore features * - Scalable Postgres backend * - pgvector for vector similarity * - Shared across multiple agent instances */ export type MemoryType = 'episodic' | 'semantic' | 'procedural' | 'working'; export interface Memory { id: string; type: MemoryType; content: string; summary?: string; source: string; timestamp: string; lastAccessed: string; importance: number; accessCount: number; decayRate: number; associations: string[]; tags: string[]; hasEmbedding: boolean; } interface PostgresMemoryConfig { connectionString: string; userId?: string; dimensions?: number; } export declare class PostgresMemoryStore { private pool; private userId; private dimensions; private initialized; constructor(config: PostgresMemoryConfig); /** * Initialize database schema */ initialize(): Promise; /** * Store a memory */ remember(content: string, options?: { type?: MemoryType; source?: string; importance?: number; tags?: string[]; }): Promise; /** * Search memories using vector similarity */ search(query: string, options?: { type?: MemoryType; limit?: number; minImportance?: number; }): Promise; /** * Find memories that contain all provided tags */ findByTags(tags: string[], options?: { type?: MemoryType; limit?: number; minImportance?: number; }): Promise; /** * Get memory by ID */ get(id: string): Promise; getById(id: string): Promise; /** * Delete a memory */ forget(id: string): Promise; /** * Update memory importance */ reinforce(id: string, boost?: number): Promise; /** * Get memory statistics */ stats(): { total: number; byType: Record; avgImportance: number; totalAssociations: number; }; private _cachedStats; /** * Update stats cache (call periodically) */ updateStatsCache(): Promise; /** * Apply temporal decay to all memories */ applyDecay(): Promise; /** * Cleanup old low-importance memories */ cleanup(options?: { maxAge?: number; minImportance?: number; }): Promise; /** * Close the connection pool */ close(): Promise; private inferType; private calculateImportance; } /** * Check if Postgres is available and configured */ export declare function isPostgresConfigured(): boolean; export {};