Skip to main content

Class: SessionRetriever

Defined in: packages/agentos/src/memory/retrieval/session/SessionRetriever.ts:124

Two-stage hierarchical retriever.

Example

const retriever = new SessionRetriever({
summaryStore,
memoryStore,
embeddingManager,
rerankerService,
defaultTopSessions: 5,
defaultChunksPerSession: 3,
});
const result = await retriever.retrieve(
'What did the user say about their rescue dog?',
{ valence: 0, arousal: 0, dominance: 0 },
{ scope: 'user', scopeId: 'u42' },
{ recallTopK: 10 },
);

Constructors

Constructor

new SessionRetriever(opts): SessionRetriever

Defined in: packages/agentos/src/memory/retrieval/session/SessionRetriever.ts:129

Parameters

opts

SessionRetrieverOptions

Returns

SessionRetriever

Methods

retrieve()

retrieve(query, mood, scope, options?): Promise<CognitiveRetrievalResult>

Defined in: packages/agentos/src/memory/retrieval/session/SessionRetriever.ts:148

Two-stage retrieve. Returns a CognitiveRetrievalResult compatible with the existing CognitiveMemoryManager.retrieve shape.

Diagnostics are best-effort: timings reflect wall-clock of each stage, not the cognitive-scorer internal accounting.

Parameters

query

string

mood

PADState

scope
scope

MemoryScope

scopeId

string

options?

SessionRetrieveOptions = {}

Returns

Promise<CognitiveRetrievalResult>