Skip to content

Graphorin API reference v0.4.0


Graphorin API reference / @graphorin/memory / facade / CreateMemoryOptions

Interface: CreateMemoryOptions

Defined in: packages/memory/src/facade.ts:71

Options accepted by createMemory.

Stable

Properties

PropertyModifierTypeDescriptionDefined in
conflictPipeline?readonlyConflictPipelineOptionsConflict pipeline configuration (Phase 10b). Default: enabled, English locale pack, thresholds 0.95 / 0.85 / 0.4. Pass { mode: 'off' } to bypass the pipeline entirely (logs a one-shot WARN per process per the spec).packages/memory/src/facade.ts:237
consolidator?readonly{ ceilings?: Partial<ConsolidatorCeilings>; cheapModel?: string | null; contextualRetrieval?: ContextualRetrievalMode; decayArchiveThreshold?: number; decayCapacity?: number | null; decayTauDays?: number; deepModel?: string | null; defaultScope?: SessionScope; dlqBaseBackoffMs?: number; dlqMaxBackoffMs?: number; dlqMaxRetries?: number; enabled?: boolean; formEpisodes?: boolean; importanceScoring?: boolean; importanceThreshold?: number; lockWaitMs?: number; maxDeepConflictsPerRun?: number; maxStandardBatchSize?: number; noiseFilters?: readonly ("default" | "minimal" | "none")[]; now?: () => number; onExceed?: OnBudgetExceed; onPhaseFinished?: PhaseListener; phases?: readonly ConsolidatorPhase[]; provider?: Provider | null; randomId?: () => string; reflection?: boolean; reflectionMaxQuestions?: number; salienceWeights?: SalienceWeights; tier?: ConsolidatorTier; triggers?: readonly ConsolidatorTriggerSpec[]; }Consolidator configuration. When omitted (or enabled: false) the facade installs the Phase 10a no-op placeholder so consumers can still type their interactions without paying the runtime cost. Pass enabled: true (or any non-tier: 'free' settings) to construct the production runtime from @graphorin/memory/consolidator.packages/memory/src/facade.ts:183
consolidator.ceilings?readonlyPartial<ConsolidatorCeilings>-packages/memory/src/facade.ts:188
consolidator.cheapModel?readonlystring | null-packages/memory/src/facade.ts:190
consolidator.contextualRetrieval?readonlyContextualRetrievalModeContextual retrieval for standard-phase fact writes (P1-3). 'llm' opts into one budgeted cheap-model call per write to author a situating prefix (consolidator-only); 'late-chunk' (default) and 'off' defer to the write-path mode. Per-tier default.packages/memory/src/facade.ts:221
consolidator.decayArchiveThreshold?readonlynumber-packages/memory/src/facade.ts:195
consolidator.decayCapacity?readonlynumber | nullCapacity-bounded eviction target for the light phase (X-1). Default unbounded.packages/memory/src/facade.ts:197
consolidator.decayTauDays?readonlynumber-packages/memory/src/facade.ts:194
consolidator.deepModel?readonlystring | null-packages/memory/src/facade.ts:191
consolidator.defaultScope?readonlySessionScope-packages/memory/src/facade.ts:222
consolidator.dlqBaseBackoffMs?readonlynumber-packages/memory/src/facade.ts:203
consolidator.dlqMaxBackoffMs?readonlynumber-packages/memory/src/facade.ts:204
consolidator.dlqMaxRetries?readonlynumber-packages/memory/src/facade.ts:202
consolidator.enabled?readonlyboolean-packages/memory/src/facade.ts:184
consolidator.formEpisodes?readonlybooleanAuto-form quarantined episodes from processed slices (P1-2). Per-tier default.packages/memory/src/facade.ts:206
consolidator.importanceScoring?readonlybooleanScore episode importance via the consolidator LLM (P1-2). Per-tier default.packages/memory/src/facade.ts:208
consolidator.importanceThreshold?readonlynumberAccumulated-importance threshold at which reflection fires (P1-1).packages/memory/src/facade.ts:212
consolidator.lockWaitMs?readonlynumber-packages/memory/src/facade.ts:193
consolidator.maxDeepConflictsPerRun?readonlynumber-packages/memory/src/facade.ts:201
consolidator.maxStandardBatchSize?readonlynumber-packages/memory/src/facade.ts:200
consolidator.noiseFilters?readonlyreadonly ("default" | "minimal" | "none")[]-packages/memory/src/facade.ts:192
consolidator.now?readonly() => numberOverride the wall clock — used by tests.packages/memory/src/facade.ts:225
consolidator.onExceed?readonlyOnBudgetExceed-packages/memory/src/facade.ts:189
consolidator.onPhaseFinished?readonlyPhaseListenerSubscribe to phase-finished events.packages/memory/src/facade.ts:229
consolidator.phases?readonlyreadonly ConsolidatorPhase[]-packages/memory/src/facade.ts:187
consolidator.provider?readonlyProvider | null-packages/memory/src/facade.ts:223
consolidator.randomId?readonly() => stringStable id seed — used by tests.packages/memory/src/facade.ts:227
consolidator.reflection?readonlybooleanRun the deep-phase reflection pass synthesizing cited insights (P1-1). Per-tier default.packages/memory/src/facade.ts:210
consolidator.reflectionMaxQuestions?readonlynumberUpper bound on salient questions reflection asks per pass (P1-1).packages/memory/src/facade.ts:214
consolidator.salienceWeights?readonlySalienceWeightsWeights for the multi-signal salience score (X-1).packages/memory/src/facade.ts:199
consolidator.tier?readonlyConsolidatorTier-packages/memory/src/facade.ts:186
consolidator.triggers?readonlyreadonly ConsolidatorTriggerSpec[]-packages/memory/src/facade.ts:185
contextEngine?readonlyContextEngineConfigContext engine configuration (Phase 10d). The engine assembles the layered six-layer system prompt; memory.compile(scope) delegates to it for the working blocks + rules + metadata fragments. When omitted, a default engine is created (English locale; 'full' base mode; no auto-recall; conservative 'public-tls' provider trust).packages/memory/src/facade.ts:246
contextualRetrieval?readonly"off" | "late-chunk"Contextual-retrieval mode for the write path (P1-3). 'late-chunk' (default) prepends a deterministic, offline situating context (entities / timeframe / topics, derived from the fact's own structured fields) to the text that is embedded + FTS-indexed, so a terse fact stays findable; the canonical text is preserved. 'off' indexes the bare text. The 'llm' enrichment is not available on the hot path — it is a consolidator-only opt-in configured via consolidator: { contextualRetrieval: 'llm' }.packages/memory/src/facade.ts:98
embedder?readonlyEmbedderProviderEmbedder provider (default: none — vector search is disabled).packages/memory/src/facade.ts:77
embeddingsreadonlyEmbeddingMetaRegistryLikeEmbedder registry. The default sqlite store exposes one as sqlite.embeddings.packages/memory/src/facade.ts:75
graph?readonlyEntityResolutionConfig & { entityResolution?: boolean; provider?: Provider; }Relation-graph entity resolution (P2-1). When entityResolution is true and the storage adapter exposes a graph surface (the default @graphorin/store-sqlite does), remember(...) resolves a fact's subject / object to canonical entities and links them, so search(..., { expandHops: 1 }) can traverse relationships. Omitted (the default) ⇒ facts still carry s/p/o but form no entity links and the write path stays offline + unchanged. Dedup is lexical + embedding (offline, via the configured embedder); LLM adjudication of ambiguous merges is a further opt-in that needs provider.packages/memory/src/facade.ts:129
iterativeRetrieval?readonly{ maxIterations?: number; maxTokens?: number; provider: Provider; }Agentic / iterative retrieval (P2-4, opt-in). When supplied, SemanticMemory.searchIterative(...) and the gated deep_recall tool can grade a retrieved set on the given provider and, for queries judged hard, reformulate + retrieve again (widening to one-hop graph expansion) up to maxIterations, abstaining instead of confabulating when memory is insufficient. Omitted (the default) ⇒ searchIterative stays a single difficulty-gated pass with no provider call, and deep_recall is not registered (the tool surface stays at the canonical eleven). Reserve it for hard multi-hop / temporal recall — it adds provider latency per pass.packages/memory/src/facade.ts:147
iterativeRetrieval.maxIterations?readonlynumberDefault total-pass cap (clamped to [1, 5]). Default 3.packages/memory/src/facade.ts:151
iterativeRetrieval.maxTokens?readonlynumberOutput-token ceiling per grade call. Default 256.packages/memory/src/facade.ts:153
iterativeRetrieval.providerreadonlyProviderCheap provider used to grade retrieved memories + reformulate.packages/memory/src/facade.ts:149
procedureInduction?readonly{ maxTokens?: number; provider: Provider; }Opt-in workflow induction (P2-2). When set, ProceduralMemory.induce(...) distils a reusable, value-abstracted procedure from a successful agent trajectory and stores it quarantined + provenance: 'induction'. Omitted (the default) ⇒ induce(...) throws ProcedureInductionNotConfiguredError and the procedural tier stays pure offline CRUD — no provider call.packages/memory/src/facade.ts:163
procedureInduction.maxTokens?readonlynumberOutput-token ceiling per induction call. Default 512.packages/memory/src/facade.ts:167
procedureInduction.providerreadonlyProviderProvider used to abstract trajectory values into a procedure.packages/memory/src/facade.ts:165
queryTransform?readonly{ maxTokens?: number; maxVariants?: number; provider: Provider; }Query transformation for retrieval (P2-3, opt-in). When supplied, SemanticMemory.search(..., { multiQuery }) fans the query into reworded variants (multi-query / RAG-Fusion) and { hyde } adds a hypothetical-answer embedding — both via one cheap LLM call on the given provider, fused through the existing RRF reranker. Omitted (the default) ⇒ search stays offline + single-shot and the multiQuery / hyde search options become silent no-ops. Reserve it for retrieval-heavy recall, not every search (it adds provider latency).packages/memory/src/facade.ts:110
queryTransform.maxTokens?readonlynumberOutput-token ceiling per transform call. Default 256.packages/memory/src/facade.ts:116
queryTransform.maxVariants?readonlynumberHard ceiling on reworded variants requested per call. Default 5.packages/memory/src/facade.ts:114
queryTransform.providerreadonlyProviderCheap provider used to rewrite the query / write the HyDE passage.packages/memory/src/facade.ts:112
reranker?readonlyReRankerOverride the reranker used by SemanticMemory.search.packages/memory/src/facade.ts:87
resolveScope?readonlyScopeResolverResolver that produces the live SessionScope for each memory-tool invocation. Defaults to a closure that throws — the agent runtime overrides it in Phase 12.packages/memory/src/facade.ts:174
storereadonlyMemoryStoreAdapterStorage adapter (default: @graphorin/store-sqlite's MemoryStore).packages/memory/src/facade.ts:73
tracer?readonlyTracerTracer used for every memory.* span. Defaults to the no-op tracer from @graphorin/core so unit tests do not need to wire the observability stack.packages/memory/src/facade.ts:85
workingBlocks?readonlyreadonly BlockDefinition[]Pre-declared working blocks (idempotent — re-defining is a no-op).packages/memory/src/facade.ts:79