Skip to content

Graphorin API reference v0.4.0


Graphorin API reference / @graphorin/memory / / FactSearchOptions

Interface: FactSearchOptions

Defined in: packages/memory/src/tiers/semantic-memory.ts:102

Per-call options accepted by SemanticMemory.search.

Stable

Extended by

Properties

PropertyModifierTypeDescriptionDefined in
asOf?readonlystringPoint-in-time ("as of") read. When set, only facts whose bi-temporal validity interval contains this instant are returned (valid_from <= asOf < valid_to, open-ended bounds allowed), applied at the store layer to both the FTS and vector candidate lists. ISO-8601. Absent ⇒ current behaviour is unchanged. P0-2. Stablepackages/memory/src/tiers/semantic-memory.ts:116
candidateTopK?readonlynumberOverride the per-list candidate count (default 60).packages/memory/src/tiers/semantic-memory.ts:106
decay?readonly{ now?: () => number; tauDays: number; }Optional decay-aware ranking. When set, the reranker output is post-multiplied by the per-fact retention curve score *= exp(-elapsedDays / tauDays) so stale facts drop in the result list without ever being hard-deleted (principle 8). Requires the storage adapter to expose semantic.listForDecay?(...) so the search can read strength + lastAccessedAt; adapters without the surface skip the boost silently. Stablepackages/memory/src/tiers/semantic-memory.ts:139
decay.now?readonly() => numberOverride the wall clock (test seam).packages/memory/src/tiers/semantic-memory.ts:142
decay.tauDaysreadonlynumber-packages/memory/src/tiers/semantic-memory.ts:140
expandHops?readonly0 | 1One-hop graph expansion (P2-1). With 1 and a graph-capable storage adapter (store.graph), the facts retrieved by the lexical / vector candidate pass are treated as seeds: facts sharing a canonical entity (subject / object) are fetched via a recursive CTE and fused in as an extra candidate list before rerank — surfacing connected facts the query never matched directly ("what did the person I met in Tbilisi recommend?"). 0 (the default) or a graph-less adapter ⇒ a silent no-op; recall is unchanged. Opt-in + retrieval-heavy. Stablepackages/memory/src/tiers/semantic-memory.ts:195
fusion?readonlyFusionStrategyScore-fusion strategy (X-2). Omitted (the default) ⇒ RRF via the configured reranker — behaviour is unchanged. { strategy: 'weighted', weights } fuses through WeightedRRFReranker, up-/down-weighting the FTS vs vector candidate lists per FusionWeights; reserve it for callers who have calibrated the weights against labels (the P0-1 eval harness). At equal weights it reproduces RRF. Stablepackages/memory/src/tiers/semantic-memory.ts:182
hyde?readonlybooleanHyDE — Hypothetical Document Embeddings (arXiv:2212.10496), P2-3. When true and both a query transformer and an embedder are configured, generate a short hypothetical answer, embed it, and fuse its vector neighbours into the result. Helps short / ambiguous queries but adds a generate + embed round-trip and can drift — hence opt-in. With no transformer (or no embedder) this is a silent no-op and no provider call is made. Stablepackages/memory/src/tiers/semantic-memory.ts:170
includeQuarantined?readonlybooleanInclude quarantined facts in the result (P1-4). Defaults to false — action-driving recall (fact_search, auto-recall) never returns quarantined rows. Set true only for the validation / inspector path that surfaces quarantined facts to a human for promotion via SemanticMemory.validate. Stablepackages/memory/src/tiers/semantic-memory.ts:126
multiQuery?readonlynumberMulti-query / RAG-Fusion (P2-3). When set to N > 1 and a query transformer is configured (createMemory({ queryTransform })), the query is fanned into up to N - 1 reworded variants via one cheap LLM call; each variant is retrieved (FTS + vector) and all lists are fused through the existing RRF reranker — recovering memories whose stored wording differs from the user's phrasing. N bounds the total query strings, including the original. Offline (no transformer, or N <= 1) this is a silent no-op: search stays single-shot and makes no provider call. Opt-in + retrieval-heavy, so reserve it for deliberate recall rather than every search. Stablepackages/memory/src/tiers/semantic-memory.ts:158
signal?readonlyAbortSignal-packages/memory/src/tiers/semantic-memory.ts:104
topK?readonlynumber-packages/memory/src/tiers/semantic-memory.ts:103