RecallOptions
Defined in: src/lib/memory/types.ts:102
Extended by
Properties
bm25AdmissionDivisor?
optionalbm25AdmissionDivisor:number
Defined in: src/lib/memory/types.ts:221
Divisor mapping BM25 scores to the admission floor. Default: 50.
budget?
optionalbudget:Budget
Defined in: src/lib/memory/types.ts:115
Search depth. Default: ‘low’.
ceWeight?
optionalceWeight:number
Defined in: src/lib/memory/types.ts:193
Multiplicative cross-encoder blend weight. Default: 0.1.
conversationId?
optionalconversationId:string
Defined in: src/lib/memory/types.ts:140
Restrict chunk search to one conversation. Chunk-only.
decomposeOptions?
optionaldecomposeOptions:PortalLlmAuth&object
Defined in: src/lib/memory/types.ts:169
Auth + endpoint for optional LLM helpers that reuse portal auth —
currently RecallOptions.graphRefine neighbor selection.
Query decomposition is not driven by this field inside recall()
(719/B4); createRecallTool reads the same shape from
RecallToolOptions.decomposeOptions for tool-layer rewrite.
Callers that still pass { budget: 'high', decomposeOptions } without
RecallOptions.subQueries keep compiling but no longer rewrite —
recall() emits decompose-moved on RecallDiagnostics.degraded
so upgrades without a changelog read still leave a telemetry breadcrumb.
Auth is the dual pattern — one of apiKey / getToken is required;
see PortalLlmAuth.
Type Declaration
baseUrl?
optionalbaseUrl:string
model?
optionalmodel:string
decryptLast?
optionaldecryptLast:boolean
Defined in: src/lib/memory/types.ts:230
Decrypt vault memory content only for the top-N ranked candidates
instead of the whole vault. Forwarded verbatim to the vault search
pipeline’s MemoryVaultSearchOptions. Default: off (legacy
whole-vault decrypt path).
embeddingCache?
optionalembeddingCache:Map<string,Float32Array<ArrayBufferLike>>
Defined in: src/lib/memory/types.ts:107
Embedding cache shared with the rest of the turn, so the query is embedded once across lanes and the send.
entityFanout?
optionalentityFanout:number
Defined in: src/lib/memory/types.ts:234
Max neighbor entities expanded per hop. Default: 8.
excludeConversationId?
optionalexcludeConversationId:string
Defined in: src/lib/memory/types.ts:142
Exclude one conversation from chunk search. Chunk-only.
factTypes?
optionalfactTypes: ("other"|"identity"|"preference"|"relationship"|"plan"|"ongoing_context"|"constraint"|"instruction")[]
Defined in: src/lib/memory/types.ts:126
Typed memory (PR1) — restrict fact recall to these FactTypes. Optional and no-op when unset (all types are eligible). Vault-only.
factTypeWeights?
optionalfactTypeWeights:Partial<Record<"other"|"identity"|"preference"|"relationship"|"plan"|"ongoing_context"|"constraint"|"instruction",number>>
Defined in: src/lib/memory/types.ts:138
PR5 — optional per-FactType score multiplier applied in the fusion boost
stage (e.g. boost identity/constraint, down-weight ongoing_context).
A type absent from the map (and untyped rows) uses 1.0, so an empty/omitted
map is a no-op (uniform weighting). Vault-only.
folderId?
optionalfolderId:string|null
Defined in: src/lib/memory/types.ts:121
Vault folder filter. Vault-only.
graphRefine?
optionalgraphRefine:boolean
Defined in: src/lib/memory/types.ts:246
PR5 — enable LLM graph path-refinement: at each traversal hop a model picks
which neighbor entities to expand instead of pure co-occurrence ranking.
Opt-in (default false); only active on the high budget (needs the
traverse flag) AND when decomposeOptions is set (reuses that auth).
Falls back to deterministic co-occurrence order on any error. Adds ≤1 LLM
call per expansion hop.
includeChunks?
optionalincludeChunks:boolean
Defined in: src/lib/memory/types.ts:117
Include source chunks for fact memories that have provenance. Default: false.
limit?
optionallimit:number
Defined in: src/lib/memory/types.ts:111
Max items returned. Default: 8.
maxHops?
optionalmaxHops:number
Defined in: src/lib/memory/types.ts:232
Total graph hops incl. the seed lookup (hop 1). Default: 1 (seed only).
maxTokens?
optionalmaxTokens:number
Defined in: src/lib/memory/types.ts:113
Token budget for the result; greedy-truncates after ranking. Not yet enforced; reserved for W1.
memoryIds?
optionalmemoryIds:string[]
Defined in: src/lib/memory/types.ts:131
Restrict fact candidates BEFORE ranking. Empty means no facts. When set,
unrestricted chunk search is disabled; it must not escape a topic scope.
Asking for "chunk" alongside this yields no excerpts and reports
"chunks-scope-restricted" on RecallDiagnostics.degraded.
minScore?
optionalminScore:number
Defined in: src/lib/memory/types.ts:144
Drop results below this score. Default: 0.1 for facts, 0.5 for chunks (mirrors today’s defaults).
mmr?
optionalmmr:boolean
Defined in: src/lib/memory/types.ts:213
Apply MMR diversification after ranking (rerank pipeline only). Default: false.
nodeBudget?
optionalnodeBudget:number
Defined in: src/lib/memory/types.ts:237
Hard cap on graph-lane memory IDs — across all hops, and on the single-hop
lane low/mid run. Default: 64.
now?
optionalnow:number
Defined in: src/lib/memory/types.ts:180
Reference “now” for resolving relative temporal phrases in the
query (“last week”, “yesterday”, “N days ago”). Default: Date.now().
Override for back-dated evaluation harnesses (bench corpora dated
2021–2023) and for deterministic tests — otherwise the W6 lane
resolves windows in 2026 and never overlaps stored event_time.
onDiagnostics()?
optionalonDiagnostics: (diagnostics:RecallDiagnostics) =>void
Defined in: src/lib/memory/types.ts:188
Best-effort observability hook. Called once per recall() with per-lane
timings, lane counts, and soft-degradation signals — the raw material for
tuning latency/quality and for wiring recall telemetry to PostHog. Invoked
synchronously just before recall() returns; a throwing callback is
swallowed (diagnostics must never break retrieval). Off unless provided.
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
void
profile?
optionalprofile:MemoryAppProfile
Defined in: src/lib/memory/types.ts:105
App profile supplying the fact-lane score floor and fact-type weights when minScore / factTypeWeights are not set.
proofCountAlpha?
optionalproofCountAlpha:number
Defined in: src/lib/memory/types.ts:219
Proof-count log-boost scale. Default: 0.1.
queryEmbedTotalTimeoutMs?
optionalqueryEmbedTotalTimeoutMs:number
Defined in: src/lib/memory/types.ts:207
Overall deadline, in ms, for embedding the query — token read, every retry
attempt and the backoff between them. Default: 8000. On expiry the fact lane
degrades to BM25 and the (cosine-only) chunk lane is skipped, reported as
embeddings-unavailable, so an embeddings outage costs a turn at most this
long rather than ~4 x the per-attempt timeout. 0 disables it.
recency?
optionalrecency:RecencyOptions
Defined in: src/lib/memory/types.ts:211
Recency decay curve overrides (per-year decay slope, floor, no-date multiplier).
recencyAlpha?
optionalrecencyAlpha:number
Defined in: src/lib/memory/types.ts:209
Recency boost slope in the fused ranker. Default: 1.0.
rerankLoadTimeoutMs?
optionalrerankLoadTimeoutMs:number
Defined in: src/lib/memory/types.ts:199
Max ms a mid/high recall waits for the cross-encoder’s FIRST model load
before degrading to the fused ranking (reported as rerank-unavailable).
Default: 10000. The load keeps going in the background for later calls.
rerankTopN?
optionalrerankTopN:number
Defined in: src/lib/memory/types.ts:191
Number of candidates fed to the cross-encoder rerank stage. Default: 5; was 30 until 2026-08-13 — see anuma-ai/sdk#845.
rrfK?
optionalrrfK:number
Defined in: src/lib/memory/types.ts:223
RRF smoothing constant for lane fusion (facts × chunks and side lanes). Default: 60.
scopes?
optionalscopes:string[]
Defined in: src/lib/memory/types.ts:119
Vault scope filter. Vault-only.
subQueries?
optionalsubQueries:string[]
Defined in: src/lib/memory/types.ts:153
Pre-decomposed facet queries for the composite ranker. When ≥2 are
supplied, the vault lane runs rankComposite over them (no LLM call
inside recall() — 719/B4). Callers that still want LLM rewrite
(e.g. createRecallTool at budget: 'high') call
decomposeQuery themselves and pass the result here. A single entry
(or omitting this) keeps the single-query path.
supersessionBoost?
optionalsupersessionBoost:number
Defined in: src/lib/memory/types.ts:215
Supersession score-gap transfer factor. Default: 0.8.
supersessionWindow?
optionalsupersessionWindow:number
Defined in: src/lib/memory/types.ts:217
Hard cap on the supersession candidate window. Default: 50.
types?
optionaltypes:MemoryKind[]
Defined in: src/lib/memory/types.ts:109
Which kinds to search. Default: [‘fact’].
vaultPreparation?
optionalvaultPreparation:VaultPreparation
Defined in: src/lib/memory/types.ts:103
Internal