Skip to documentation
Docs navigation
Docs/RetrieverConfig
Types

RetrieverConfig

TypeScript contract for RetrieverConfig.

What it does

TypeScript contract for RetrieverConfig.

Use RetrieverConfig to keep application code aligned with the values MemoGrafter accepts or returns at this boundary. It is a TypeScript-only contract and adds no runtime behavior.

Definition

TypeScript
interface RetrieverConfig {
  limit?: number;
  minSimilarity?: number;
  tokenBudget?: number;
  tags?: string[];
  tagMode?: "all" | "any";
  scope?: "session" | "session-and-tags" | "tagged";
  sessionIds?: string[];
  scoring?: { similarityWeight?: number; confidenceWeight?: number };
  cache?: { ttlSeconds?: number };
}

Fields and behavior

limit? (number) — Maximum number of ranked memory facts to return.
minSimilarity? (number) — Minimum semantic similarity required for a match.
tokenBudget? (number) — Maximum token budget for assembled prompt context.
tags?, tagMode?, scope?, sessionIds? — Control tag matching and authorized session scope.
scoring? — Blend semantic similarity and stored confidence; defaults are 0.7 and 0.3 respectively.
cache.ttlSeconds? — Override the retrieval-cache lifetime for this operation.

Result

A compile-time-only TypeScript contract with no runtime value.

Example

example.ts
import type { RetrieverConfig } from "memo-grafter";

function useValue(value: RetrieverConfig) {
  return value;
}

Important behavior

Use import type when the contract is not needed at runtime.