import type { IEmbedding } from './embedding.mongo'; export type Messages = { role: string; content: string; }[] | string; export type Memory = { id: string; } & Omit; export type MemorySearchReturnType = { memories: Memory[]; total: number; }; export type MemoryGetAllReturnType = { memories: Memory[]; total: number; page: number; page_size: number; total_pages: number; }; export type MemoryDeleteReturnType = { success: boolean; id: string; }; export type MemoryDeleteAllReturnType = { success: boolean; deleted_count: number; }; export type MemoryUsersReturnType = { user_ids: string[]; agent_ids: string[]; run_ids: string[]; app_ids: string[]; }; export type MemoryBatchUpdateReturnType = { results: ({ success: boolean; id: string; memory: Memory; } | { success: boolean; id: string; error: string; })[]; }; export type MemoryBatchDeleteReturnType = { results: ({ success: boolean; id: string; } | { success: boolean; id: string; error: string; })[]; }; export type MemoryFactReturnType = { id: string; memory: string; user_id?: string; agent_id?: string; run_id?: string; app_id?: string; metadata: Record; categories: string[]; }; export type MemoryFactsReturnType = { results: MemoryFactReturnType[]; }; export type MemoryAddReturnType = T extends string ? { id: string; content: string; user_id?: string; agent_id?: string; run_id?: string; app_id?: string; } : MemoryFactsReturnType; export declare class MongoRagClient { private readonly gemini_api_key; private genAI; private readonly EMBEDDING_DIMENSIONS; constructor({ gemini_api_key }: { gemini_api_key: string; }); /** * Checks if the vector search index exists and creates it if not */ private ensureVectorIndex; private generateEmbedding; /** * Check if input is a conversation (array of messages with role/content) */ private isConversation; /** * Extract facts from conversation messages using AI * @param messages - Array of message objects * @returns Array of extracted facts about the user */ private extractFactsFromConversation; /** * Private helper method to check for duplicate memories * @param content - The content to check for duplicates * @param options - The options that define what constitutes a duplicate * @returns The existing memory document if found, or null if no duplicate exists */ private checkForDuplicate; /** * Add a memory * @param messages - String content or array of message objects * @param options - Configuration options including identifiers and metadata * @returns Either a single memory or extracted facts depending on input format */ add(messages: T, options?: { user_id?: string; agent_id?: string; run_id?: string; app_id?: string; metadata?: Record; categories?: string[]; expiration_date?: string | Date; }): Promise>; /** * Search for similar memories * @param query - Search query text * @param options - Search configuration options */ search(query: string, options?: { user_id?: string; agent_id?: string; run_id?: string; app_id?: string; categories?: string[]; metadata?: Record; threshold?: number; limit?: number; filters?: Record; }): Promise; /** * Get all memories * @param options - Options for filtering memories */ getAll(options?: { user_id?: string; agent_id?: string; run_id?: string; app_id?: string; categories?: string[]; keywords?: string; page?: number; page_size?: number; filters?: Record; }): Promise; /** * Get a specific memory by ID * @param memoryId - The ID of the memory to retrieve */ get(memoryId: string): Promise; /** * Update a memory * @param memoryId - The ID of the memory to update * @param content - New content for the memory * @param options - Additional update options */ update(memoryId: string, content: string, options?: { metadata?: Record; categories?: string[]; expiration_date?: string | Date; }): Promise; /** * Delete a memory * @param memoryId - The ID of the memory to delete */ delete(memoryId: string): Promise; /** * Delete all memories matching the criteria * @param options - Criteria for memories to delete */ deleteAll(options?: { user_id?: string; agent_id?: string; run_id?: string; app_id?: string; }): Promise; /** * Delete users, agents, or runs * @param options - Criteria for users/agents/runs to delete */ delete_users(options?: { user_id?: string; agent_id?: string; run_id?: string; app_id?: string; }): Promise<{ success: boolean; deleted_count: number; }>; /** * Get all unique users, agents, and runs in the system */ users(): Promise; /** * Batch update multiple memories * @param updates - Array of memory updates */ batchUpdate(updates: { memory_id: string; text: string; metadata?: Record; categories?: string[]; }[]): Promise; /** * Batch delete multiple memories * @param deletes - Array of memory IDs to delete */ batchDelete(deletes: { memory_id: string; }[]): Promise; private formatMemory; private processFilters; } //# sourceMappingURL=client.d.ts.map