Skip to main content

Class: ObservationReflector

Defined in: packages/agentos/src/memory/observation/ObservationReflector.ts:105

Condenses compressed observations into higher-level reflections.

Runs when accumulated compressed observations exceed 40,000 tokens (configurable). Each reflection captures a long-lived pattern such as a user preference, behavioral habit, capability, relationship dynamic, or goal.

Constructors

Constructor

new ObservationReflector(llmInvoker): ObservationReflector

Defined in: packages/agentos/src/memory/observation/ObservationReflector.ts:109

Parameters

llmInvoker

(system, user) => Promise<string>

Function that calls an LLM with (system, user) prompts.

Returns

ObservationReflector

Methods

reflect()

reflect(observations): Promise<Reflection[]>

Defined in: packages/agentos/src/memory/observation/ObservationReflector.ts:119

Reflect on compressed observations to extract higher-level patterns.

Parameters

observations

CompressedObservation[]

Compressed observations to reflect on.

Returns

Promise<Reflection[]>

Array of reflections. Returns empty array on LLM failure.