import type { AgentAdapter } from './types.js'; export interface DistillationInput { /** The IM platform (telegram / wechat / ...). */ platform: string; /** The IM user id (the human). Used as the memory partition key. */ userId: string; /** The user's prompt that triggered the agent. */ userMessage: string; /** The agent's reply text. */ agentReply: string; /** The agent that produced the reply. Used for the extraction call. */ agent: AgentAdapter; /** Optional: tracing id linking the extraction back to its source turn. */ traceId?: string; /** Optional: only run distillation when the reply or message reaches a * minimum length. Skips trivial exchanges like "ok" / "thanks". */ minLen?: number; } export interface TurnPair { user_message: string; agent_reply: string; } export interface BatchResult { ok: boolean; saved: number; } /** * Extract + save facts from a batch of buffered turns for one user. * `ok=true` means the LLM ran and its output parsed — safe to clear the buffer * even if 0 facts were worth keeping. `ok=false` means no usable LLM, so the * caller should keep the turns and retry on the next pass. */ export declare function runBatchDistillation(key: string, turns: TurnPair[], representativeAgent: string): Promise; /** * Single-turn distillation (direct/legacy entry). Delegates to the batch path * with a one-turn batch. The hot path no longer calls this — it buffers via * scheduleDistillation and the background distiller batches. */ export declare function runDistillation(input: DistillationInput): Promise; /** * Post-reply hook (router.ts). Dream distillation: just BUFFER the turn on the * hot path (a single SQLite insert, zero LLM). The background distiller * (memory-distiller.ts) batch-extracts buffered turns when the system is idle. * Trivial exchanges ("ok" / "thanks") are skipped. Returns immediately. */ export declare function scheduleDistillation(input: DistillationInput): void; //# sourceMappingURL=memory-distill.d.ts.map