Interface CognitiveMemoryConfig

interface CognitiveMemoryConfig {
    workingMemory: IWorkingMemory;
    knowledgeGraph: IKnowledgeGraph;
    vectorStore: IVectorStore;
    embeddingManager: IEmbeddingManager;
    agentId: string;
    traits: HexacoTraits;
    moodProvider: (() => PADState);
    featureDetectionStrategy: "hybrid" | "llm" | "keyword";
    featureDetectionLlmInvoker?: ((systemPrompt, userPrompt) => Promise<string>);
    encoding?: Partial<EncodingConfig>;
    decay?: Partial<DecayConfig>;
    workingMemoryCapacity?: number;
    tokenBudget?: Partial<MemoryBudgetAllocation>;
    observer?: Partial<ObserverConfig>;
    reflector?: Partial<ReflectorConfig>;
    graph?: Partial<MemoryGraphConfig>;
    consolidation?: Partial<ConsolidationConfig>;
    persistentMemory?: PersistentMemorySource;
    cognitiveMechanisms?: CognitiveMechanismsConfig;
    infiniteContext?: Partial<InfiniteContextConfig>;
    maxContextTokens?: number;
    collectionPrefix?: string;
    enableGraphActivation?: boolean;
    brain?: Brain;
    persistAccessState?: boolean;
    rerankerService?: RerankerService;
    archive?: IMemoryArchive;
    typedNetwork?: TypedNetworkRuntimeConfig;
}

Properties

workingMemory: IWorkingMemory
knowledgeGraph: IKnowledgeGraph
vectorStore: IVectorStore
embeddingManager: IEmbeddingManager
agentId: string
traits: HexacoTraits
moodProvider: (() => PADState)

Callback to get current mood from MoodEngine or similar.

Type declaration

featureDetectionStrategy: "hybrid" | "llm" | "keyword"

Default

'keyword'
featureDetectionLlmInvoker?: ((systemPrompt, userPrompt) => Promise<string>)

Required when strategy is 'llm' or 'hybrid'.

Type declaration

    • (systemPrompt, userPrompt): Promise<string>
    • Parameters

      • systemPrompt: string
      • userPrompt: string

      Returns Promise<string>

encoding?: Partial<EncodingConfig>
decay?: Partial<DecayConfig>
workingMemoryCapacity?: number

Default

7 (Miller's number)
tokenBudget?: Partial<MemoryBudgetAllocation>
observer?: Partial<ObserverConfig>
reflector?: Partial<ReflectorConfig>
graph?: Partial<MemoryGraphConfig>
consolidation?: Partial<ConsolidationConfig>
persistentMemory?: PersistentMemorySource

Optional persistent markdown memory source injected into every prompt.

This is separate from active working memory: working memory is the bounded cognitive focus, while persistent memory is durable agent/user state such as profile notes, preferences, and identity anchors.

cognitiveMechanisms?: CognitiveMechanismsConfig

Optional per-mechanism cognitive science extensions (reconsolidation, RIF, FOK, etc.).

infiniteContext?: Partial<InfiniteContextConfig>

Infinite context window config. Enables transparent compaction for forever conversations.

maxContextTokens?: number

Max context window size in tokens (required for infinite context).

collectionPrefix?: string

Default

'cogmem'
enableGraphActivation?: boolean

Step 13: enable graph activation. Propagates to MemoryStoreConfig.enableGraphActivation. When true, the internal MemoryStore upserts entity nodes + related_to:co_occurs edges at encode time (from trace.entities), and seeds Anderson spreading activation from query-extracted entities at retrieve to compute the sixth composite-scoring signal. Default: false (legacy behavior, graphActivation signal is a silent zero).

Default

false
brain?: Brain

Optional Brain instance for durable persistence.

When provided, memory traces, knowledge graph nodes/edges, prospective items, and observation pipeline state are persisted to the brain's SQL tables via sql-storage-adapter. The in-memory vector index remains the hot read path; Brain is the durable backing store that survives process restarts.

Falls back to in-memory-only storage when omitted.

Default

undefined (in-memory only)

See

Brain — the cross-platform persistence layer

persistAccessState?: boolean

Keeps each trace's stability, access count, reinforcement interval and next reinforcement time across a restart: written to the Brain (with no Brain, to the vector store's metadata) at every access and read back at load (MemoryStoreConfig.persistAccessState). false writes and loads them as before, for one release of before-and-after measurement.

Default

true
rerankerService?: RerankerService

Optional reranker service for post-retrieval quality improvement.

When provided, retrieved memory traces are reranked after the cognitive scoring pipeline (vector similarity + strength + recency + emotional congruence + graph activation + importance). The reranker score is blended with the existing composite score at a 0.7/0.3 weighting to preserve cognitive signals while boosting semantically relevant results.

Recommended: Cohere rerank-v3.5 primary, LLM-Judge fallback.

Default

undefined (no reranking)
archive?: IMemoryArchive

Optional memory archive, read by CognitiveMemoryManager.rehydrate(), which returns a trace's archived verbatim content.

The manager hands this archive to neither the temporal-gist mechanism nor its consolidation pipeline, so setting it does not make gisting keep a verbatim copy.

Default

undefined (no archive; rehydrate() returns null)

See

IMemoryArchive, the archive contract, exported from @framers/agentos/memory/archive/IMemoryArchive

typedNetwork?: TypedNetworkRuntimeConfig

Stage E: optional Hindsight 4-network typed observer wiring.

When provided, encode() additionally extracts typed facts (World / Experience / Opinion / Observation banks) via the configured LLM and persists them in an in-memory TypedNetworkStore. retrieve() runs typed-graph spreading activation ('full' variant only) and produces a 4-way RRF fused ranking that's merged into the existing scoring.

Variants:

  • 'minimal': bank routing + observer only (no graph traversal at retrieve).
  • 'full': minimal + spreading activation per Hindsight Eq. 12 + 4-way RRF.

Default

undefined (Stage E disabled, zero-cost no-op)

See

packages/agentos-bench/docs/specs/2026-04-26-hindsight-4network-observer-design.md