mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1438] [LTM] One-syllable Korean names fail particle stripping in lexical retrieval #730
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#730
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 @tlsiddl on GitHub (Oct 17, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1438
Originally assigned to: @Promansis on GitHub.
Summary
One-syllable Korean character names may fail lexical retrieval when different grammatical particles are attached.
I previously reported this edge case in #1295 and left a follow-up comment after that issue was closed.
Since the issue has already been resolved and subsequent Korean name matching improvements do not appear to cover this case, I’m opening a separate report to make it easier to track.
Affected package
Marinara LTM (Long-Term Memory)
Expected behavior
Known one-syllable Korean character names should be recognized consistently, regardless of attached grammatical particles.
For example:
Keyword and BM25 retrieval should match these forms when the stem is a known character or persona name.
Actual behavior
The previously identified particle-stripping logic requires at least two characters to remain after removing a particle.
As a result, one-syllable names may not be normalized correctly, potentially preventing keyword/BM25 matches.
This has not yet been independently retested against the latest staging version.
Steps to reproduce
Environment
Logs, screenshots, or video
No logs or screenshots are attached for this specific edge case.
The suspected restriction was previously identified in hangul-lexical.ts:
for (let length = 1; length <= 4 && value.length - length >= 2; length += 1)
The value.length - length >= 2 condition prevents the function from returning a one-syllable stem.
This may affect particle stripping even if one-syllable names are otherwise preserved during token extraction.
Additional context
Related:
Suggested fix:
Allow one-syllable stems when they match a known character or persona name, while keeping the existing minimum-length restrictions for unrelated tokens to avoid false positives.
It would also be helpful to add regression tests for one-syllable names with different Korean particles.
Could you confirm whether the latest staging changes already handle this case, or whether a separate fix is still needed?
Thanks for your continued work on Korean retrieval support!
Template check
@Promansis commented on GitHub (Oct 17, 2026):
Minimal fix
Confirmed by reading the code at
upstream/stagingf87531a32(Long-Term Memory 1.4.45). It hasn't been run live.S=packages/long-term-memory/src/engine/packages/server/src/services/long-term-memoryWhy it fails
S/bm25.ts:33skips every token of one character, so린on its own is never indexed or searched.S/hangul-lexical.ts:43requires two syllables to remain after the particle is removed.S/bm25.ts:38only adds a stem longer than one character.린이,린은and린에게stay three unrelated terms.S/keyword-extract.ts:222drops Hangul keywords under two syllables. That also removes a one-syllable title from #1363's known-names set (S/retrieval.ts:166).S/hangul-lexical.ts:9-12,:37-40).나는→나,그는→그,집에→집.Known names
characternotes. #1363 already treats these as names. Persona profiles arecharacternotes too: they carry a persona subject ref (fixture attests/long-term-memory-routes.regression.ts:1388-1398).S/rebuild.ts:294-298).Steps
S/hangul-lexical.ts: addhangulNameSyllable(token, names).isHangulParticlefinal-consonant rule, so린이,린은,린에게and린으로fold but린는doesn't.stripHangulParticleand its two-syllable floor don't change.S/bm25.ts:ltmHangulNameSyllables(chunks).characterchunks, lowercased and NFC.{ noteType?, title? }, so it works on bothLtmMemoryChunkandindex.metadata.chunks.tokenizeLtmText(text, names?)pusheshangulNameSyllable(token, names)as an alias. This happens before the one-character skip, so a bare린counts as well.originalCount.buildLtmBm25Index(chunks)takes the names from its own chunks.searchLtmBm25gets an optionalnameSyllablesand tokenizes the query with it.S/retrieval.ts:index.metadata.chunksand pass it tosearchLtmBm25(:150).S/chunking.ts:20: bumpCURRENT_LTM_CHUNK_FORMAT_VERSIONfrom 5 to 6.S/rebuild.ts:69).tests/long-term-memory-routes.regression.ts:1078asserts 5 and needs updating.## Unreleased: one-syllable Korean character and persona names now match with any particle in lexical recall when the vault has a memory profile under that name. Existing vaults rebuild their recall indexes once.Not in this fix
ponytail:comment inltmHangulNameSyllablesrecords this limit.S/subject-identity.ts:1996(followedByHangulParticle) and:2011(matchDirectName) keep refusing one-syllable names.Regression proof
Extend the #1295 block in
tests/long-term-memory-index-keys.regression.ts(:718). It is already in theltm-browser.ymlregression list.Fixtures:
characterchunk titled린;린이 웃었다,린에게 반지를 줬다and린, 괜찮아?;나는 시장에 갔다;린character chunk.Checks:
린은 뭐 했지?,린을and린each find all three린memories.나를doesn't match나는 시장에 갔다, because나isn't a name.린은 뭐 했지?finds none of them, which is today's behavior.Also run
routes(format version 6),runtimeandreconciliation-recall.Size