export interface HistoryManager { addHistory( memoryId: string, previousValue: string | null, newValue: string | null, action: string, createdAt?: string, updatedAt?: string, isDeleted?: number, userId?: string, runId?: string, messageId?: string, happenedAt?: string, ): Promise; getHistory(memoryId: string, options?: { userId?: string, runId?: string }): Promise; getAllMessages(options?: { userId?: string, runId?: string, limit?: number }): Promise; /** * Get messages surrounding a specific message to provide context * @param messageId The reference message ID * @param options Filter and window size options * @returns Array of context messages before and after the reference message */ getMessageContext( messageId: string, options: { beforeCount?: number; afterCount?: number; userId?: string; runId?: string; } ): Promise; /** * Get detailed message information for a specific memory (for agents) * @param memoryId The memory ID to get details for * @returns Array of detailed message information */ getMessageDetails(memoryId: string): Promise; /** * Get conversation context for a specific memory (for agents) * @param memoryId The memory ID to get conversation context for * @returns Array of conversation context messages */ getMessageConversationContext(memoryId: string): Promise; // Entity management methods addEntity( entityId: string, label: string, type: string, userId?: string, runId?: string, ): Promise; updateEntity( entityId: string, label: string, type: string, userId?: string, runId?: string, ): Promise; deleteEntity(entityId: string): Promise; getEntity(entityId: string): Promise; getAllEntities(options?: { userId?: string, runId?: string }): Promise; associateMemoryWithEntities(memoryId: string, entityIds: string[]): Promise; getMemoryEntities(memoryId: string): Promise; reset(): Promise; close(): void; /** * Store raw messages independently of memory creation * @param messages Array of messages to store * @param metadata Message metadata including userId, runId, messageId * @returns Promise that resolves when messages are stored */ storeRawMessages( messages: any[], metadata: { userId?: string; runId?: string; messageId: string; batchInfo?: any; } ): Promise; /** * Search through all stored messages (not just memories) * @param query Search query or filters * @param options Search options including limit, userId, runId * @returns Array of matching messages */ searchMessages( query: string, options?: { userId?: string; runId?: string; limit?: number; timeRange?: { start?: string; end?: string }; } ): Promise; /** * Get messages by message ID pattern or exact match * @param messageIdPattern Message ID or pattern to search for * @param options Additional search options * @returns Array of matching messages */ getMessagesByPattern( messageIdPattern: string, options?: { userId?: string; runId?: string; exact?: boolean; } ): Promise; }