UNPKG

@codai/memorai-core

Version:

Core memory engine with vector operations for AI agents

68 lines 2.21 kB
import type { MemoryResult, ContextRequest, ContextResponse, MemoryType, MemoryConfig } from '../types/index.js'; export interface RememberOptions { type?: MemoryType; importance?: number; emotional_weight?: number; tags?: string[]; context?: Record<string, unknown>; ttl?: Date; } export interface RecallOptions { type?: MemoryType; limit?: number; threshold?: number; include_context?: boolean; time_decay?: boolean; } export declare class MemoryEngine { private config; private embedding; private vectorStore; private isInitialized; constructor(config?: Partial<MemoryConfig>); initialize(): Promise<void>; /** * Natural language interface for agents: remember new information */ remember(content: string, tenantId: string, agentId?: string, options?: RememberOptions): Promise<string>; /** * Natural language interface for agents: recall relevant memories */ recall(query: string, tenantId: string, agentId?: string, options?: RecallOptions): Promise<MemoryResult[]>; /** * Natural language interface for agents: forget specific memories */ forget(query: string, tenantId: string, agentId?: string, confirmThreshold?: number): Promise<number>; /** * Natural language interface for agents: get contextual information */ context(request: ContextRequest): Promise<ContextResponse>; /** * Health check for the memory system */ healthCheck(): Promise<{ status: 'healthy' | 'unhealthy'; components: Record<string, boolean>; memory_count?: number; }>; /** * Get system health status */ getHealth(): Promise<{ status: 'healthy' | 'degraded' | 'unhealthy'; checks: Record<string, boolean>; timestamp: Date; }>; /** * Close connections and clean up resources */ close(): Promise<void>; private ensureInitialized; private classifyMemoryType; private calculateImportance; private applyTimeDecay; private generateContextSummary; private generateContextText; private calculateContextConfidence; } //# sourceMappingURL=MemoryEngine.d.ts.map