fix(agent): make the recall reranker opt-in and use the word embedder in tests

The reference-set comparison showed the cross-encoder adds nothing to mem0's
ranking and costs about 130 ms per search.
This commit is contained in:
shumeiko.it
2026-10-24 11:57:18 +02:00
parent 10e67f37a5
commit 2d507dc457
2 changed files with 21 additions and 13 deletions

View File

@@ -28,14 +28,20 @@ if (!process.env.WAGGLE_PHASE5_CANARY_PCT) {
process.env.WAGGLE_PHASE5_CANARY_PCT = '0';
}
// W4.5: the cross-encoder reranker is default-ON in production (kill switch
// WAGGLE_RERANKER=0). Tests pin it OFF — the real ONNX model is a ~22MB
// download + per-call CPU inference, both unwanted in unit suites. Tests
// that exercise reranking inject a mock Reranker via OrchestratorConfig.
// The cross-encoder reranker is opt-in (WAGGLE_RERANKER=1). Tests pin it
// OFF explicitly; tests that exercise reranking inject a mock Reranker via
// OrchestratorConfig.
if (!process.env.WAGGLE_RERANKER) {
process.env.WAGGLE_RERANKER = '0';
}
// Memory (ADR-0007): the sidecar embeds memories with an in-process model
// that is a ~90MB download. Tests use the deterministic word embedder, which
// needs no model and no network.
if (!process.env.WAGGLE_MEMORY_EMBEDDER) {
process.env.WAGGLE_MEMORY_EMBEDDER = 'words';
}
// W4 (2026-06-11): the PromptAssembler is default-ON in production (kill
// switch WAGGLE_PROMPT_ASSEMBLER=0) after the live chat smoke. Tests pin it
// OFF so the broad chat-route suite keeps exercising the stable legacy