WOLBΛRG

recall()

Semantic and hybrid search with filters, thresholds, MMR, and rerank.

Signature

recall(options: RecallOptions): Promise<RecallResult[]>

Options

FieldDefaultDescription
queryNatural-language query (required)
topK5Max results (1–1000)
threshold0Minimum cosine similarity
filteragent, includeArchived, metadata
hybridtrue or weights; needs keywordSearch
mmrDiversification; true or { lambda }
rerankfalseUses configured reranker; skips if absent

Example

import { meta } from "wolbarg";

const hits = await ctx.recall({
  query: "billing invoices",
  topK: 8,
  threshold: 0.25,
  hybrid: { semanticWeight: 0.7, keywordWeight: 0.3 },
  mmr: { lambda: 0.6 },
  rerank: true,
  filter: {
    agent: "research",
    metadata: meta.and(
      meta.eq("topic", "billing"),
      meta.gte("priority", 1),
    ),
  },
});