/** * pi-loom: Fact Extraction Engine * * Mem0-style atomic fact extraction from stored memories. * Facts are stored in the memories table with "extracted-fact" tag, * making them automatically searchable via FTS5 and context injection. * * Bridge to ESR: facts are anchored to the same entity_id as their parent. */ import type { ExtensionContext } from "@earendil-works/pi-coding-agent"; import type { LoomStore, MemRow } from "./store.js"; export interface FactExtractConfig { modelProvider?: string; modelId?: string; } export interface FactExtractResult { memory_count: number; fact_count: number; fact_ids: string[]; } /** * Extract atomic facts from memories and store them as searchable fact memories. * * Pipeline: raw memories → LLM extract atomic facts → store as memories → FTS5 indexed → searchable. * Facts inherit entity_id + importance from parent, with "extracted-fact" + "entity:..." tags. */ export declare function extractFacts(store: LoomStore, memories: MemRow[], ctx: ExtensionContext | null, config?: FactExtractConfig): Promise;