/** * Digest engine — document ingestion pipeline for cortex. * * Takes raw document content (markdown with optional YAML frontmatter) and * runs it through a configurable pipeline of cognitive steps. Each step is * isolated in a try/catch so a single failure does not abort the pipeline. * * Pipeline steps: * observe — embed and store content as observations (with prediction error gating) * reflect — generate LLM insights connecting content to existing memories * predict — extract forward-looking claims and store as prediction observations * extract — LLM-categorize content into typed observations (beliefs, questions, * hypotheses, reflections) using the existing content_type system */ import type { CortexStore } from '../core/store.js'; import type { EmbedProvider } from '../core/embed.js'; import type { LLMProvider } from '../core/llm.js'; export interface DigestOptions { /** Pipeline of cognitive steps. Default: ['observe', 'reflect'] */ pipeline?: string[]; /** Target namespace (default: 'default') */ namespace?: string; /** Source file path for provenance */ source_file?: string; /** Salience override (default: auto-detect from content) */ salience?: number; } export interface DigestResult { /** IDs of observations created */ observation_ids: string[]; /** Memories that were linked or created */ memories_linked: string[]; /** Insights generated during reflect step */ insights: string[]; /** Pipeline steps that ran */ pipeline_executed: string[]; /** Timestamp of processing */ processed_at: Date; /** Duration in ms */ duration_ms: number; /** Count of inner-loop or top-level catches that swallowed an error. */ failures: number; } /** * Process a document through the cortex ingestion pipeline. * * Parses frontmatter, detects salience, then runs each requested pipeline step * in sequence. Steps are isolated — a single step failure does not abort the * pipeline; it is logged as skipped. * * Supported steps: 'observe', 'reflect', 'predict' * Unknown steps are silently skipped and recorded in pipeline_executed as * 'skipped:'. */ export declare function digestDocument(content: string, store: CortexStore, embed: EmbedProvider, llm: LLMProvider, options?: DigestOptions): Promise; //# sourceMappingURL=digest.d.ts.map