/**
 * Memory Repository
 *
 * Repository for persistent memory storage with vector embeddings.
 */
import type Database from 'better-sqlite3';
import type { Memory, MemoryType } from '../schema.js';
export interface MemoryFilter {
    type?: MemoryType | MemoryType[];
    scope?: 'user' | 'project';
    projectId?: string;
    minImportance?: number;
    limit?: number;
    offset?: number;
}
export interface MemorySearchResult {
    memory: Memory;
    similarity: number;
}
export declare class MemoryRepository {
    private db;
    constructor(db?: Database.Database);
    /**
     * Create a new memory
     */
    create(memory: Omit<Memory, 'access_count' | 'created_at' | 'last_accessed'>): Memory;
    /**
     * Get memory by ID
     */
    getById(id: string): Memory | null;
    /**
     * Find memories by filter
     */
    find(filter?: MemoryFilter): Memory[];
    /**
     * Search memories by semantic similarity
     */
    searchSimilar(embedding: Float32Array, filter?: MemoryFilter, topK?: number): MemorySearchResult[];
    /**
     * Update memory
     */
    update(id: string, updates: Partial<Omit<Memory, 'id' | 'created_at'>>): boolean;
    /**
     * Delete memory
     */
    delete(id: string): boolean;
    /**
     * Delete expired memories
     */
    deleteExpired(): number;
    /**
     * Get memory statistics
     */
    getStats(): {
        total: number;
        byType: Record<MemoryType, number>;
        byScope: Record<string, number>;
        avgImportance: number;
    };
    /**
     * Bulk insert memories
     */
    bulkCreate(memories: Omit<Memory, 'access_count' | 'created_at' | 'last_accessed'>[]): number;
    private deserializeMemory;
    private cosineSimilarity;
}
export declare function getMemoryRepository(): MemoryRepository;
export declare function resetMemoryRepository(): void;
