mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1197] [Issue]: Long-Term Memory: debug recall explanation must reflect injected chunks and weighted-lane threshold #611
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#611
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Oct 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1197
Originally assigned to: @Promansis on GitHub.
Summary
The Long-Term Memory recall debug event (
recall_explanation) reports the pre-serialization candidate list and per-lane score, so it can show memories that were never injected, and it never explains the threshold decision. Fix the diagnostics and the user-facing threshold wording only — do not change scoring or ranking.Affected package
long-term-memoryExpected behavior
relevanceScore, and exposes whether the threshold accepted or rejected a candidate.Actual behavior
generation-injection.ts(packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/generation-injection.ts) builds therecall_explanationevent fromretrieval.chunks(uiSummary ~line 121, selected mapping ~134-141, rejected ~142-149).serializeLongTermMemoryPrompt(.../prompt.ts) can drop chunks to fit the framing/preamble/maxTokens budget (prompt.ts:63-108), returning only the chunks inartifact.chunks. The receipt and UI use the injected artifact, but the debug event can list extra memories that were never sent.score: candidate.relevanceScorein the debug details ismax(normalizedRawScore * lane.weight)(.../ranking.ts:60), while ordering uses the fusedcandidate.score; the threshold also comparescandidate.relevanceScore(.../budget.ts:105-114). Debug therefore shows a score that does not explain either rank or the threshold outcome.Steps to reproduce
maxTokens/budgetTokens.Observed in the 2026-10-01 tight-budget fixture: the debug event listed two selected chunks while
serializeLongTermMemoryPromptinjected only one.Environment
engine.min)1.3.39(current upstreamstaging)Logs, screenshots, or video
The debug details contain, for each selected/rejected candidate,
score: relevanceScore,lanes,reasons, and (for rejected)rejectionReason. They do not contain the fused score or the threshold comparison result. Example threshold behavior under balanced weights (from the characterization fixtures): atthreshold=0.50the #1-ranked candidate is rejected while the #2-ranked candidate is kept.Additional context
A16/B11/B1), read-only investigation undermarinara-workflow.A16: debug lists pre-serialization chunks.B11: debug shows lane score, not fusion.B1: threshold uses the lane-weight-cappedrelevanceScore. Per-lane ceilings under balanced weights: direct 1.00, vector 0.60, bm25 0.30, keyword 0.20, graph 0.10, so any threshold >= 0.60 rejects every vector-only match even at high cosine. The threshold is inert by default (0).warnings/cooldown plumbing; unit 6 (A18) changes vector reuse and tone hashing.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: