feat(memory): recognize multilingual recall intent - #138
Merged
Merged
Conversation
Add bounded native-script question cues for nine more languages and traditional Chinese variants. Use Unicode word boundaries, preserve legacy English/Chinese scoring, and fall back to GENERAL when additional-language cues conflict. Document supported forms, limits, and language-independent overrides in recall and host guidance. Validate with go build -o mnemon ., make test, and CLI E2E (232/232). An isolated CLI reproduction of issue #132 improves automatic selection from 6/33 to 33/33; explicit overrides remain 33/33.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Automatic recall intent recognizes bounded WHY, WHEN and ENTITY question cues in Hindi, Spanish, Modern Standard Arabic, French, Bengali, Portuguese, Indonesian, Russian and German, alongside English and Mandarin Chinese. It supports documented script variants, Unicode word boundaries and common punctuation/diacritics without a language service or additional provider.
Unrecognized or conflicting additional-language cues fall back to GENERAL. Same-intent mixed-language cues can agree. English/Chinese keyword scoring and tie-breaking remain in place, with Unicode boundary checks and traditional Chinese variants.
--intentcontinues to override automatic selection in any language; recall help and canonical host guidance explain how to use it while preserving the original-language query.Why
Fixes #132. On base
6c371ec7dce7af05aa55f31fb1b7c1aea81205db, the issue's 33 CLI queries select the expected intent in only 6 cases, while explicit overrides work for all 33. Intent controls graph traversal and ranking, so an automatic GENERAL fallback changes retrieval strategy.These are targeted synthetic intent-selection probes, not an estimate of general language understanding or cross-language retrieval accuracy. The implementation does not translate queries, infer arbitrary phrasing, or resolve semantic ambiguity. The supported forms and fallback behavior are documented in
docs/USAGE.mdand its Chinese counterpart.Example CLI comparison in a fresh synthetic store with embeddings unavailable:
Before, all three automatic calls report GENERAL. After, they report WHY, WHEN and ENTITY respectively, with
meta.intent_source: "auto". Adding the corresponding--intentgives the same strategy withmeta.intent_source: "override".Validation
go build -o mnemon .andmake testpass, includinggo vet ./....bash scripts/e2e_test.sh: 232/232 checks pass with embeddings unavailable.retell me about). The matcher now resumes after a rejected match without hiding valid later cues; regression tests and 48 narrow independent boundary checks confirm the correction.make test, and all 258 combined CLI E2E checks. Both PRs are independently based onmaster.Checklist
make test)bash scripts/e2e_test.sh); full Agency/process/Docker integration is outside this Memory-only change