export { L as ListOptions, M as Memory, c as MemoryAdapter, d as MemoryAdapterFactory, a as MemoryScope, b as RecordOptions, R as RetrieveOptions } from '../../types-B_kkAV7t.mjs'; import { LanguageModel } from 'ai'; /** * Post-turn memory extraction. * * Two strategies, both producing a `{ upserts, deletes }` delta: * 1. LLM extraction (recommended) — `generateObject` against a cheap/fast * model with a structured schema; can add new facts AND supersede stale * ones. The system prompt forbids storing secrets/credentials/unvolunteered * PII. * 2. Heuristic (fallback, no extra model call) — a small rule set that * captures explicit imperative preferences ("always…", "I prefer…", * "call me…", "remember that…") and stores them verbatim. * * Either way the output runs a redaction pass that drops obvious secret patterns * before persistence. */ interface MemoryDelta { upserts: { text: string; kind: string; }[]; deletes: string[]; } /** Drop any upsert that looks like it carries a secret. */ declare function redactDelta(delta: MemoryDelta): MemoryDelta; /** Flatten a UI/Model message's text parts for the extraction prompt. */ declare function renderTurn(messages: unknown[]): string; /** LLM extraction via `generateObject`. Returns an empty delta on any failure. */ declare function llmExtract(model: LanguageModel, turnText: string, existing: { id: string; text: string; }[]): Promise; /** * Heuristic extraction — zero extra model call. Captures explicit imperative * preferences the user states. Lower recall, no cost/latency. */ declare function heuristicExtract(turnText: string): MemoryDelta; export { type MemoryDelta, heuristicExtract, llmExtract, redactDelta, renderTurn };