Skip to content

feat(memory): recognize multilingual recall intent - #138

Merged
Grivn merged 1 commit into
masterfrom
codex/issue-132-multilingual-intent
Sep 14, 2026
Merged

Grivn merged 1 commit into
masterfrom
codex/issue-132-multilingual-intent

Conversation

@Grivn

@Grivn Grivn commented Sep 14, 2026

Copy link
Copy Markdown
Member

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. --intent continues 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.

Original issue probe Before After
English and Mandarin automatic queries 6 / 6 6 / 6
Other nine languages, automatic queries 0 / 27 27 / 27
All explicit overrides 33 / 33 33 / 33

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.md and its Chinese counterpart.

Example CLI comparison in a fresh synthetic store with embeddings unavailable:

go build -o mnemon .
export MNEMON_DATA_DIR="$(mktemp -d)"
export MNEMON_STORE=intent-repro
export MNEMON_EMBED_ENDPOINT=http://127.0.0.1:1
export MNEMON_EMBED_PROTOCOL=ollama
export MNEMON_EMBED_API_KEY=
./mnemon remember 'PostgreSQL was selected for its transaction support.' --cat decision
./mnemon recall '¿Por qué elegimos PostgreSQL?' --verbose
./mnemon recall 'हमने PostgreSQL कब चुना?' --verbose
./mnemon recall 'Was ist PostgreSQL?' --verbose

Before, all three automatic calls report GENERAL. After, they report WHY, WHEN and ENTITY respectively, with meta.intent_source: "auto". Adding the corresponding --intent gives the same strategy with meta.intent_source: "override".

Validation

  • go build -o mnemon . and make test pass, including go vet ./....
  • bash scripts/e2e_test.sh: 232/232 checks pass with embeddings unavailable.
  • The issue's original 33 automatic queries and 33 corresponding overrides were run against actual baseline and fixed binaries in fresh stores; complete JSON responses and reusable scripts are retained locally.
  • Sixteen additional real CLI graph probes cover script/punctuation variants, Unicode substring guards, GENERAL and mixed-language conflicts. Automatic results match the corresponding explicit override's IDs, scores, signals and ranking after normalizing unspecified equal-score tie order. Twenty basic CLI operations also pass.
  • Independent review found a legacy compound-match edge case (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.
  • A local combination with fix(memory): preserve distinct facts during remember and import #139 merged without conflicts and passed build, make test, and all 258 combined CLI E2E checks. Both PRs are independently based on master.

Checklist

  • Deterministic tests pass (make test)
  • Affected CLI E2E component passes (bash scripts/e2e_test.sh); full Agency/process/Docker integration is outside this Memory-only change
  • New behavior covers original 33 questions, script variants, GENERAL, mixed intents and Unicode boundaries
  • Recall help, English/Chinese usage and pipeline docs, and distributed host guidance updated
  • Release-note impact: supported multilingual questions automatically choose the existing retrieval strategies; explicit override remains available

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.
@Grivn
Grivn merged commit 404fa88 into master Sep 14, 2026
2 checks passed
@Grivn
Grivn deleted the codex/issue-132-multilingual-intent branch September 14, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Support multilingual recall intent detection beyond English and Chinese

1 participant