Skip to main content

Class: HybridStrategy

Defined in: packages/agentos/src/cognition/memory/pipeline/context/strategies/HybridStrategy.ts:36

Implements​

Constructors​

Constructor​

new HybridStrategy(llmInvoker?, observer?, reflector?): HybridStrategy

Defined in: packages/agentos/src/cognition/memory/pipeline/context/strategies/HybridStrategy.ts:52

Parameters​

llmInvoker?​

(prompt) => Promise<string>

Writes the narrative summary. Without one, or when it fails or answers nothing, the summary is the ten most important observation notes, or without notes the segment's first three user messages, cut to the tokens the segment held less the summary message's header, after an earlier summary in the segment, carried forward as far as the window has room for it under the compaction threshold.

observer?​

MemoryObserver

Extracts observation notes from the segment.

reflector?​

MemoryReflector

Consolidates the notes into memory traces.

Returns​

HybridStrategy

Properties​

name​

readonly name: "hybrid"

Defined in: packages/agentos/src/cognition/memory/pipeline/context/strategies/HybridStrategy.ts:37

Implementation of​

ICompactionStrategy.name

Methods​

compact()​

compact(input, config): Promise<CompactionResult>

Defined in: packages/agentos/src/cognition/memory/pipeline/context/strategies/HybridStrategy.ts:62

Parameters​

input​

CompactionInput

config​

InfiniteContextConfig

Returns​

Promise<CompactionResult>

Implementation of​

ICompactionStrategy.compact