Adjust summary prompt labels and budgets

This commit is contained in:
2026-02-05 13:46:28 +08:00
parent 8137e206f9
commit 6171195350

View File

@@ -32,6 +32,7 @@ function canNotifyRecallFail() {
// ─────────────────────────────────────────────────────────────────────────────
const MAIN_BUDGET_MAX = 10000; // 主装配预算(世界/事件/远期/弧光)
const ORPHAN_MAX = 2500; // 远期上限
const RECENT_ORPHAN_MAX = 5000; // [待整理] 独立预算
const TOTAL_BUDGET_MAX = 15000; // 总预算(用于日志显示)
const L3_MAX = 2000;
@@ -174,7 +175,7 @@ function formatArcLine(a) {
.filter(Boolean);
if (moments.length) {
return `- ${a.name}${moments.join(" → ")}(当前:${a.trajectory}`;
return `- ${a.name}${moments.join(" → ")}`;
}
return `- ${a.name}${a.trajectory}`;
}
@@ -657,7 +658,7 @@ async function buildVectorPrompt(store, recallResult, causalById, queryEntities
const orphans = orphanCandidates
.sort((a, b) => (a.floor - b.floor) || ((a.chunkIdx ?? 0) - (b.chunkIdx ?? 0)));
const l1Budget = { used: 0, max: total.max - total.used };
const l1Budget = { used: 0, max: Math.min(ORPHAN_MAX, total.max - total.used) };
let l0Count = 0;
let contextPairsCount = 0;
@@ -807,13 +808,13 @@ async function buildVectorPrompt(store, recallResult, causalById, queryEntities
if (assembled.orphans.lines.length) {
sections.push(`[更早以前] 记忆里残留的老画面\n${assembled.orphans.lines.join("\n")}`);
}
// 5. 待整理 → 刚发生的
// 5. 待整理 → 近期
if (assembled.recentOrphans.lines.length) {
sections.push(`[刚发生的] 还没来得及想明白\n${assembled.recentOrphans.lines.join("\n")}`);
sections.push(`[近期] 清晰但还没整理\n${assembled.recentOrphans.lines.join("\n")}`);
}
// 6. 人物弧光 → 这些人
if (assembled.arcs.lines.length) {
sections.push(`[这些人] 他们现在怎样了\n${assembled.arcs.lines.join("\n")}`);
sections.push(`[这些人] 他们的弧光\n${assembled.arcs.lines.join("\n")}`);
}
if (!sections.length) {