recall()
Semantic and hybrid search with filters, thresholds, MMR, and rerank.
Signature
recall(options: RecallOptions): Promise<RecallResult[]>Options
| Field | Default | Description |
|---|---|---|
query | — | Natural-language query (required) |
topK | 5 | Max results (1–1000) |
threshold | 0 | Minimum cosine similarity |
filter | — | agent, includeArchived, metadata |
hybrid | — | true or weights; needs keywordSearch |
mmr | — | Diversification; true or { lambda } |
rerank | false | Uses 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),
),
},
});