UNPKG

magnitude-core

Version:
38 lines (37 loc) 1.32 kB
import { MultiMediaMessage } from '@/ai/baml_client'; import { Observation, ObservationRetentionOptions, ObservationRole, ObservationSource } from './observation'; import { MultiMediaJson } from './serde'; import { Image as BamlImage } from '@boundaryml/baml'; export interface SerializedAgentMemory { instructions?: string; observations: { source: ObservationSource; role: ObservationRole; timestamp: number; data: MultiMediaJson; options?: ObservationRetentionOptions; }[]; } export interface AgentMemoryOptions { instructions?: string | null; promptCaching?: boolean; thoughtLimit?: number; } export interface MemoryRenderOptions { } export declare class AgentMemory { private options; private observations; private freezeMask?; private cacheControlIndices; constructor(options?: AgentMemoryOptions); get instructions(): string | null; render(options?: MemoryRenderOptions): Promise<MultiMediaMessage[]>; simpleRender(): Promise<(BamlImage | string)[]>; isEmpty(): boolean; recordThought(content: string): void; recordObservation(obs: Observation): void; getLastThoughtMessage(): string | null; toJSON(): Promise<SerializedAgentMemory>; loadJSON(data: SerializedAgentMemory): Promise<void>; }