A view to hand to one session (one GMI).
Stage E: typed-network store, or null when typed-network not configured.
Stage E: typed-network observer (LLM extractor), or null.
Stage E: typed spreading activation, or null (only set for 'full' variant).
Encode a new input into a memory trace. Called after each user message.
Optional type?: MemoryTypeOptional scope?: MemoryScopeOptional scopeOptional sourceOptional contentOptional tags?: string[]Optional entities?: string[]Optional turnMemoryTrace.turnUserId: set on a trace a turn with no learner files for a second user.
Optional perspectiveWhen 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.
Retrieve relevant memories for a query. Called before prompt construction.
Assemble memory context for prompt injection within a token budget.
Feed a conversation message to the observation pipeline.
Pipeline flow:
encode() (typed as semantic/episodic/etc.)Message role (user, assistant, system, tool)
Message text content
Optional mood: PADStateOptional PAD emotional state at observation time
Optional options: { Optional contentObservation notes if threshold was reached, null otherwise
Check prospective memory triggers (Batch 2).
Optional now?: numberOptional events?: string[]Optional queryOptional queryOptional maxPolicy-tier ceiling forwarded to prospective.check, so the direct
prospective-check path gates by session tier exactly like the assembly
path (assembleForPrompt) already does.
Register a new prospective reminder/intention.
List active prospective reminders.
Rehydrate a gisted/archived trace to its original verbatim content.
Delegates to the configured IMemoryArchive. Returns null when no
archive is configured or when the trace is not found/integrity fails.
The trace id to rehydrate.
Optional requestContext: stringOptional caller hint for audit.
The original verbatim content, or null.
Run consolidation cycle (Batch 2).
Get memory health diagnostics.
Run context window compaction if needed. Call BEFORE assembling the LLM prompt. Returns the (potentially compacted) message list for the conversation. If infinite context is disabled, returns null (caller should use original messages).
Get context window transparency stats.
Get compaction history for audit/UI.
Search compaction history for a keyword.
Get the context window manager (for advanced usage).
Access the underlying long-term memory store for diagnostics/devtools.
Delete every trace of one scope for good (MemoryStore.deleteScope), a batch at a time. What this manager keeps
of each trace in a batch goes before the batch's traces (forgetTraces), so a call that fails part way can
be made again and finds the same traces. With turnUserId, only the scope's traces that user filed as a second
user on the session.
Optional turnTypeError when scopeId is empty, or when turnUserId is given and is not a non-empty string.
Delete the given traces for good, as deleteScope does for a scope. An id the store finds no trace of (no Brain row, nothing it holds) is skipped, and nothing this manager keeps under that id is touched.
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.
How many traces its re-file moved: none when the Brain held the record already.
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 without reaching into getStore().
Access the working-memory model for diagnostics/devtools.
Get the resolved cognitive-memory runtime config.
Get graph module when enabled.
Get observer module when enabled.
Step-8: accessor mirror of getObserver, for the reflector.
Step-8: Force the reflector to run over pending notes regardless of threshold. Encodes reflection traces, soft-deletes superseded IDs. Safe to call when no reflector or no pending notes exist (returns an empty result). Errors do not propagate — reflection is non-critical.
scopeOverride forces every encoded reflection trace to use the
caller-supplied scope + scopeId, overriding whatever the reflector
LLM invented. Callers that want all reflection traces to land in a
single canonical scope (e.g. bench adapters that retrieve under
user/bench) should pass this override.
Optional mood: PADStateOptional scopeOverride: { Get prospective-memory manager when enabled.
Export the full brain state as a JSON string. Delegates to JsonExporter through the MemoryStore's brain. Throws if no brain is attached.
Optional options: ExportOptionsImport a JSON brain payload into the attached brain. Delegates to JsonImporter through the MemoryStore's brain. Throws if no brain is attached.
Optional options: Pick<ImportOptions, "dedup">Attach a HyDE retriever to enable hypothesis-driven memory recall.
When set, the retrieve() and assembleForPrompt() methods can accept
options.hyde = true to generate a hypothetical memory trace before
searching. This improves recall for vague or abstract queries by
producing embeddings that are semantically closer to stored traces.
A pre-configured HydeRetriever instance, or null
to disable HyDE.
memoryManager.setHydeRetriever(new HydeRetriever({
llmCaller: myLlmCaller,
embeddingManager: myEmbeddingManager,
config: { enabled: true },
}));
Get the HyDE retriever if configured, or null.
Return the attached neural reranker, or null when none is
configured. Public read-only accessor for Step-3 bench wiring:
the bench constructs a per-case HybridRetriever that needs the
same reranker the manager uses, without bracket-accessing the
private field.
This manager as one session sees it: the same store, graph and mechanisms, with a working memory of its own.
encode,retrieveandassembleForPrompton the view focus traces in that working memory, and the view's active context lists only the traces the session encoded or recalled. Sessions that call the manager directly share its one working memory, whose slot list (trace ids and activations) is part of every assembled context.shutdown()on the view does nothing: whoever owns the manager shuts it down.