import Database from 'better-sqlite3'; /** * Claim extraction: parse atomic, verifiable facts from text. * No LLM calls — uses sentence splitting + heuristic patterns. * * A "claim" is an atomic statement that can be independently verified: * - "neuromcp uses SQLite for storage" * - "The API has 12 endpoints" * - "Python 3.12 added type parameter syntax" * * Claims are stored in the `claims` table and linked to their source memory. */ interface Claim { readonly id: string; readonly memory_id: string; readonly content: string; readonly subject: string | null; readonly predicate: string | null; readonly object: string | null; readonly confidence: number; readonly created_at: string; } interface ClaimExtractionResult { readonly claims: readonly Claim[]; readonly raw_sentences: number; readonly filtered: number; } /** * Extract atomic claims from memory content. * * Pipeline: * 1. Split into sentences * 2. Filter to declarative sentences (not questions, commands, fragments) * 3. Extract subject-predicate-object triples where possible * 4. Score confidence based on specificity */ declare function extractClaims(db: Database.Database, memoryId: string, content: string): ClaimExtractionResult; /** * Retrieve claims for a memory. */ declare function getClaimsForMemory(db: Database.Database, memoryId: string): readonly Claim[]; /** * Search claims by content. */ declare function searchClaims(db: Database.Database, query: string, limit?: number): readonly Claim[]; /** * Pure (no-DB) triple extraction over free text. Used by contradiction * detection to align claims between two memories before allowing an * auto-supersede. */ declare function extractTriplesFromText(text: string): readonly Triple[]; interface Triple { readonly subject: string; readonly predicate: string; readonly object: string; } export { type Claim, type ClaimExtractionResult, type Triple, extractClaims, extractTriplesFromText, getClaimsForMemory, searchClaims };