mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1363] [Issue]: LTM recall: a character's name loses name credit at the start of a sentence, in lowercase, or in a caseless script #694
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#694
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 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1363
Originally assigned to: @Promansis on GitHub.
Summary
Since #1264, a single ordinary keyword match gets half keyword credit, but a name keeps full credit. LTM decides what counts as a name only by capitalisation: a capitalised word that is not at the start of a sentence, quote or line. A character's name therefore loses name credit when the user starts a sentence with it, types in lowercase, or writes in a script without letter case, such as Korean. The vault already knows its characters' names, but recall doesn't use them.
Affected package
long-term-memory1.4.30 (upstream/staginga468f18e6), underpackages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/:keyword-index.ts:queryNameTerms(lines 66-77), used by the single-keyword cap (lines 206-214)retrieval.ts:159: the keyword search calltests/long-term-memory-index-keys.regression.ts:380-440(the #1264 name cases)Expected behavior
Actual behavior
With a character memory titled "Mira" and the keyword
mira:Mirais mid-sentence, so it counts as a name and keeps full credit.Mirastarts the sentence, so it does not count as a name. The match is capped at half credit.Steps to reproduce
charactermemory titled "Mira" with the keywordmira, and nothing else in common with the chat.balancedstyle with debug logging on.Environment
>=2.4.1 <4.0.0)upstream/staginga468f18e6)Logs, screenshots, or video
Evaluation context (aggregate only; the evaluation uses a real vault):
Additional context
Minimal fix:
retrieveLongTermMemory, build a set of known names from the allowed chunks whosenoteTypeischaracter. Use each chunk's title in lowercase, plus each title word that is not a stop word and is at least 2 characters long.searchLtmKeywordIndexas an optionalknownNamesoption. In the single-keyword cap (keyword-index.ts:212), a term inknownNamesalso keeps full credit.Known limits:
subject-identity.ts:48,:499), not on stored memories. Matching aliases is a follow-up.Related: #1264 (single-keyword cap and name rule), #1360 (linked recall, which starts from the memories this improves).
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: