/** * SQLiteProvider — 默认存储后端 * 使用 better-sqlite3,FTS5 全文索引,事务保证原子性。 */ import type { KnowledgeEntry, EntryStatus, KnowledgeType } from '../types/index.js'; import type { StorageProvider, SemanticQuery, SearchResult, SaveOptions } from './storage-provider.js'; export interface SQLiteProviderOptions { dbPath: string; configDir?: string; } export declare class SQLiteProvider implements StorageProvider { private db; private readonly qualityGate; constructor(options: SQLiteProviderOptions); private initSchema; /** * Semantic dedup: BGE vector similarity. * Computes embedding for new entry, searches existing entries by cosine similarity. * Returns the id of the duplicate entry if similarity > 0.9. */ private checkSemanticDuplicate; save(entry: KnowledgeEntry, options?: SaveOptions): Promise; findById(id: string): Promise; /** * Vector cosine similarity search using Ollama bge-m3 embeddings. * Returns null if embedding generation fails or no embeddings exist (graceful fallback). */ private vectorSearch; search(query: SemanticQuery): Promise; updateStatus(id: string, status: EntryStatus): Promise; getVersionHistory(id: string): Promise; findByType(type: KnowledgeType): Promise; fullTextSearch(query: string, limit?: number): Promise; findAll(): Promise; delete(id: string): Promise; count(): Promise; close(): Promise; private rowToEntry; } //# sourceMappingURL=sqlite-provider.d.ts.map