Improve cross_device MemFuse recall with source tags and recallContext.
Auto-enable device/location prefixes for cross_device scenarios, thread question_device into keyword and embedding paths, and boost lexical scores from source-tag tokens. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -450,6 +450,10 @@ export async function runMemFuseBenchCase({
|
||||
query: testCase.question,
|
||||
limit,
|
||||
candidateLimit,
|
||||
recallContext: {
|
||||
device: testCase.questionDevice || null,
|
||||
user: testCase.questionUser || null,
|
||||
},
|
||||
});
|
||||
|
||||
const retrieved = result.memories.map((memory) => memory.id).filter(Boolean);
|
||||
@@ -548,7 +552,9 @@ export async function runMemFuseBench({
|
||||
questionIds,
|
||||
});
|
||||
if (cases.length === 0) continue;
|
||||
const corpus = buildScenarioCorpus(scenario, { includeSourceTags });
|
||||
const needsSourceTags = includeSourceTags
|
||||
|| cases.some((testCase) => String(testCase.dimension).startsWith('cross_device_'));
|
||||
const corpus = buildScenarioCorpus(scenario, { includeSourceTags: needsSourceTags });
|
||||
if (typeof prefetchEmbedTexts === 'function') {
|
||||
await prefetchEmbedTexts([
|
||||
...corpus.rows.map((row) => row.content),
|
||||
|
||||
Reference in New Issue
Block a user