mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1905] [Feature]: Long-Term Memory: one character note when a chat uses both a short and a full name #1818
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#1818
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 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1905
Originally assigned to: @Promansis on GitHub.
What problem does this solve?
When a chat calls the same side character "Preston" in one place and "Preston Farraday" in another, Long-Term Memory writes two character notes: one per name. Each note collects half of that character's facts, recall finds only the half whose name matches, and facts end up split or in conflict across the two.
This happens for characters LTM creates from the chat itself (characters that aren't a card or a persona). LTM already relates a short name to a card or persona with a longer name, and sends that match to review instead of making a new note. It doesn't do this for characters it created on its own, so each name form gets its own note.
It gets worse as pieces get smaller, because each piece is a new chance to see a different name form:
Smaller pieces add 60–80 real facts per vault in that test. So stopping these splits is what makes smaller pieces worth having.
Proposed package or change
When LTM resolves a character name from a new piece, it also relates that name to its own characters in the same chat by whole name parts, the way it already does for cards and personas:
Before / after, for two pieces of one chat:
Why a unique match binds on its own instead of going to review: both notes are LTM's own guesses from the same chat, so no card or persona is at stake. Sending each one to review would hold back every split fact in a whole-chat import until the user reviews it, and there would be dozens. The ambiguous cases still fail closed.
Minimal fix
Under
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/identity/:subject-matching.tsmatchTrustedNameRelation(~150) andpartialNameCandidateEntries(~118) only consider entries that are an exact/alias match or passisTrustedCharacterOrPersonaSubject(~110). Add LTM's own character entries in the same chat family (familyIdset,sourceScopelocal_noteorlocal_source) as candidates:local_name_relation), matched;identityReviewthe trusted case builds.partial_name_requires_review, and a trusted match outranks a local one.subject-names.tspartialNameTokensMatch(~203) checks only short-name-to-longer-entry. The local relation also needs the reverse (a longer new name to a shorter existing entry), using the same whole-token rule.subject-identity.tspreResolveBatchSubjectNames(~808) andresolveAndCacheSubjectName(~915) already callmatchTrustedNameRelationfor names that aren't known. Check that the new basis flows through them, and that names in the same batch ("Preston" and "Preston Farraday" both new in one piece) relate before provisional entries are made, which is thebatch_provisional_duplicatepath (~958).matchDirectinstead of the relation.subject-catalog.tsfamilyIdandsourceScope: "local_note"; nothing to change there.mutableHasRelatedIdentity(~556) keeps short source-note names from creating a duplicate of a trusted subject. Extend it to local entries in the same family the same way, so source-note names and extracted names follow one rule.Regression: extend the table of short-name cases (#1291) in
tests/long-term-memory-extraction-graph.regression.ts(~3384), which already builds a catalog and resolves one named unit:partial_name_requires_review.identityKeyForUnit) and resolution agree for cases 1–3, as the borrowing tests already check.Non-goals
aliasesornicknamesfield already covers a card character, and it is read today (subject-catalog.tsextractAliases).Why should this be optional?
It shouldn't be a setting. It only joins LTM's own characters when exactly one fits on whole name parts, and anything less certain goes to review. A setting would mostly leave users with duplicate notes they didn't choose.
Alternatives considered
Additional context
Template check
@Promansis commented on GitHub (Oct 30, 2026):
Fixed by #1909, merged to staging as
a5acc6329.