/** * Read API for Observational Memory. * * `buildObservationalContext` assembles the three tiers — reflections (highest * level) + observations (dense) + the recent raw message tail — into a single * structure ready to fold into a prompt. It is intentionally NOT wired into * production-agent.ts here; see the exported seam note below and the package * barrel export so the wire-up is one call later. * * Token-cheap by construction: a long thread is represented by its compacted * tiers plus only the last N raw turns, instead of the entire transcript. */ import type { EngineMessage } from "../engine/types.js"; import { type ObservationalMemoryConfig } from "./config.js"; import type { ObservationalContext, ObservationalMemoryOwner } from "./types.js"; export interface BuildObservationalContextOptions extends ObservationalMemoryOwner { threadId: string; /** The full, ordered thread messages — the recent tail is taken from here. */ messages: EngineMessage[]; config?: Partial; } /** * Build the three-tier Observational Memory context for a thread. The returned * tiers are ready to be injected into the turn's prompt assembly. * * This is consumed by the agent loop (`production-agent.ts`): when a thread has * persisted observations/reflections, the older raw-message prefix (everything * before `recentMessages`) is replaced with the `reflections` + `observations` * text, `recentMessages` is kept verbatim, and a short "Observational Memory" * block is prepended. Threads with no OM entries are left unchanged. */ /** True when this thread has at least one persisted observation or reflection. */ export declare function hasObservationalMemory(context: ObservationalContext): boolean; /** * Serialize the reflections + observations tiers into a single, clearly * delimited prompt block. The recent-raw-message tail is NOT serialized here — * it stays as verbatim engine messages — so this block represents only the * compacted older history that replaces the raw prefix. * * Returns an empty string when there is nothing compacted yet, so callers can * cheaply skip injection for short threads. */ export declare function serializeObservationalMemoryBlock(context: ObservationalContext): string; export declare function buildObservationalContext(options: BuildObservationalContextOptions): Promise; //# sourceMappingURL=read.d.ts.map