Skip to main content

Interface: ICognitiveMemoryManager

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:110

Methods​

assembleForPrompt()​

assembleForPrompt(query, tokenBudget, mood, options?): Promise<AssembledMemoryContext>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:147

Assemble memory context for prompt injection within a token budget.

Parameters​

query​

string

tokenBudget​

number

mood​

PADState

options?​

CognitiveRetrievalOptions

Returns​

Promise<AssembledMemoryContext>


checkProspective()?​

optional checkProspective(context): Promise<ProspectiveMemoryItem[]>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:163

Check prospective memory triggers (Batch 2).

Parameters​

context​
events?​

string[]

maxTierRank?​

number

Policy-tier ceiling: drop prospective items whose tierRank exceeds it, matching the assembly path. Forwarded to prospective.check.

now?​

number

queryEmbedding?​

number[]

queryText?​

string

Returns​

Promise<ProspectiveMemoryItem[]>


deleteScope()?​

optional deleteScope(scope, scopeId, options?): Promise<MemoryDeletion>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:287

Delete every trace of one scope for good, as an account deletion needs: its memory-graph node, its original in the configured archive and the typed facts extracted from it, then the trace in the cache (every store over the Brain in this process keeps none of its words), the vector index and the Brain, and the knowledge graph's episodic copy (MemoryStore.deleteScope). With no Brain, the scope's documents in the vector index are found and deleted too, those another store filed before a restart included. With turnUserId, only the scope's traces that user filed as a second user on the session (MemoryTrace.turnUserId). Optional, so a host's own implementation keeps compiling.

Parameters​

scope​

MemoryScope

scopeId​

string

options?​
turnUserId?​

string

Returns​

Promise<MemoryDeletion>

Throws​

TypeError when scopeId is empty, so a caller's missing id never deletes every trace filed under no scope id, or when turnUserId is given and is not a non-empty string.


deleteTraces()?​

optional deleteTraces(traceIds): Promise<MemoryDeletion>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:293

Delete the given traces for good, as deleteScope does for a scope. An id with no Brain row and no trace in the store is skipped; with no Brain, a trace the store never loaded is reached through deleteScope alone.

Parameters​

traceIds​

readonly string[]

Returns​

Promise<MemoryDeletion>


encode()​

encode(input, mood, gmiMood, options?): Promise<MemoryTrace>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:114

Encode a new input into a memory trace. Called after each user message.

Parameters​

input​

string

mood​

PADState

gmiMood​

string

options?​
contentSentiment?​

number

entities?​

string[]

perspectiveSource?​

{ eventHash: string; eventId: string; }

When encoding a subjective trace from PerspectiveObserver (@framers/agentos/memory/pipeline/observation/PerspectiveObserver), thread the source-event identifiers through so the resulting MemoryTrace carries the MechanismMetadata fields that applyReconsolidation reads at retrieval time.

perspectiveSource.eventHash​

string

perspectiveSource.eventId​

string

scope?​

MemoryScope

scopeId?​

string

sourceType?​

MemorySourceType

tags?​

string[]

turnUserId?​

string

MemoryTrace.turnUserId: set on a trace a turn with no learner files for a second user.

type?​

MemoryType

Returns​

Promise<MemoryTrace>


ensureEncodedScopeIds()?​

optional ensureEncodedScopeIds(): Promise<number>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:303

Re-files the Brain's plain user and persona scope ids that hold a /, a % or a : in the encoded form a learning layer reads, once per Brain, and moves what the manager's store holds of the traces it moved; on a Brain another handle or process re-filed, the store follows the Brain's rows (MemoryStore.ensureEncodedScopeIds). The layer calls it when it first opens the manager. Optional, so a host's own implementation keeps compiling.

Returns​

Promise<number>

How many traces its re-file moved: none when the Brain held the record already.


flushReflection()​

flushReflection(mood?, scopeOverride?): Promise<FlushReflectionResult>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:233

Step-8: Force the memory reflector to run over any pending observation notes regardless of accumulated-token threshold. Encoded reflection traces land in the memory store; superseded trace IDs are soft-deleted. Returns the IDs so callers can apply side effects (e.g. BM25 indexing).

Parameters​

mood?​

PADState

Optional mood override passed to each encoded trace.

scopeOverride?​

When set, overrides the scope + scopeId on every reflection-derived trace before encoding. Needed when the caller (e.g. bench adapter) needs all reflection traces to land in the same scope the retrieval path queries, regardless of what the reflector LLM invented.

scope​

MemoryScope

scopeId​

string

Returns​

Promise<FlushReflectionResult>


getConfig()​

getConfig(): CognitiveMemoryConfig

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:209

Get the resolved cognitive-memory runtime config.

Returns​

CognitiveMemoryConfig


getContextTransparencyReport()​

getContextTransparencyReport(): string | null

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:262

Get a human-readable compaction/transparency report when enabled.

Returns​

string | null


getContextWindowStats()​

getContextWindowStats(): ContextWindowStats | null

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:259

Get infinite-context runtime stats when enabled.

Returns​

ContextWindowStats | null


getGraph()​

getGraph(): IMemoryGraph | null

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:212

Get graph module when enabled.

Returns​

IMemoryGraph | null


getHydeRetriever()?​

optional getHydeRetriever(): HydeRetriever | null

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:248

Get the HyDE retriever if configured, or null.

Returns​

HydeRetriever | null


getMemoryHealth()​

getMemoryHealth(): Promise<MemoryHealthReport>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:192

Get memory health diagnostics.

Returns​

Promise<MemoryHealthReport>


getObserver()​

getObserver(): MemoryObserver | null

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:215

Get observer module when enabled.

Returns​

MemoryObserver | null


getProspective()​

getProspective(): ProspectiveMemoryManager | null

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:239

Get prospective-memory manager when enabled.

Returns​

ProspectiveMemoryManager | null


getReflector()​

getReflector(): MemoryReflector | null

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:218

Get the memory reflector if configured, or null.

Returns​

MemoryReflector | null


getRerankerService()?​

optional getRerankerService(): RerankerService | null

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:256

Get the attached neural reranker, or null when none is configured. Step 3 uses this so the bench-side HybridRetriever can plumb the manager's reranker into the per-case retriever without bracket-accessing a private field.

Returns​

RerankerService | null


getStore()​

getStore(): MemoryStore

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:195

Access the underlying long-term memory store for diagnostics/devtools.

Returns​

MemoryStore


getTraceCount()​

getTraceCount(): number

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:203

Total number of memory traces currently resident in the manager's in-memory trace cache. Ergonomic passthrough to MemoryStore.getTraceCount; used by agentos-bench for memory-footprint telemetry.

Returns​

number


getWorkingMemory()​

getWorkingMemory(): CognitiveWorkingMemory

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:206

Access the working-memory model for diagnostics/devtools.

Returns​

CognitiveWorkingMemory


initialize()​

initialize(config): Promise<void>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:111

Parameters​

config​

CognitiveMemoryConfig

Returns​

Promise<void>


listProspective()?​

optional listProspective(): Promise<ProspectiveMemoryItem[]>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:183

List active prospective reminders.

Returns​

Promise<ProspectiveMemoryItem[]>


observe()?​

optional observe(role, content, mood?, options?): Promise<ObservationNote[] | null>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:155

Feed a message to the observer (Batch 2). Returns notes if threshold reached.

Parameters​

role​

"user" | "tool" | "system" | "assistant"

content​

string

mood?​

PADState

options?​
contentSentiment?​

number

Returns​

Promise<ObservationNote[] | null>


registerProspective()?​

optional registerProspective(input): Promise<ProspectiveMemoryItem>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:176

Register a new prospective reminder/intention.

Parameters​

input​

Omit<ProspectiveMemoryItem, "id" | "createdAt" | "triggered" | "cueEmbedding"> & object

Returns​

Promise<ProspectiveMemoryItem>


rehydrate()?​

optional rehydrate(traceId, requestContext?): Promise<string | null>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:273

Return the verbatim content that was archived when this trace was consolidated, or null if the trace is not gisted/archived or the archive is unreachable.

Parameters​

traceId​

string

The trace id to rehydrate.

requestContext?​

string

Optional caller hint for audit.

Returns​

Promise<string | null>

The original verbatim content, or null.


removeProspective()?​

optional removeProspective(id): Promise<boolean>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:186

Remove a prospective reminder.

Parameters​

id​

string

Returns​

Promise<boolean>


retrieve()​

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

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:140

Retrieve relevant memories for a query. Called before prompt construction.

Parameters​

query​

string

mood​

PADState

options?​

CognitiveRetrievalOptions

Returns​

Promise<CognitiveRetrievalResult>


runConsolidation()?​

optional runConsolidation(): Promise<ConsolidationResult>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:189

Run consolidation cycle (Batch 2).

Returns​

Promise<ConsolidationResult>


setHydeRetriever()?​

optional setHydeRetriever(retriever): void

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:245

Attach a HyDE retriever for hypothesis-driven memory recall. Pass null to disable.

Parameters​

retriever​

HydeRetriever | null

Returns​

void


shutdown()​

shutdown(): Promise<void>

Defined in: packages/agentos/src/cognition/memory/CognitiveMemoryManager.ts:306

Shutdown and release resources.

Returns​

Promise<void>