feat: babel-memory integration — multilingual FTS & prompts#14
Merged
win4r merged 2 commits intowin4r:mainfrom Apr 9, 2026
Merged
feat: babel-memory integration — multilingual FTS & prompts#14win4r merged 2 commits intowin4r:mainfrom
win4r merged 2 commits intowin4r:mainfrom
Conversation
…rompts Integrate babel-memory (optional dependency) for language-aware memory processing: - language-hook.ts: auto-detects babel-memory at startup, graceful degradation - store.ts: pre-tokenize BM25 queries for CJK languages (jieba/kuromoji) - kg-extractor.ts: language-aware KG extraction prompts (EN/CJK) - session-distiller.ts: language-aware session summary prompts (EN/CJK) - ingestion-pipeline.ts: detect language and store in metadata - 18 tests covering both with/without babel-memory paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Integrate babel-memory as an optional dependency to enhance UltraMemory's multilingual capabilities:
Design
All integration goes through a single
language-hook.tsmodule that auto-detects babel-memory at startup. Zero breaking changes — when babel-memory is not installed, all functions gracefully degrade to current behavior (English passthrough).Files changed
language-hook.tsbabel-memory.d.tsstore.tstokenizeQuery()kg-extractor.tsgetLocalizedKgPrompt()session-distiller.tsgetLocalizedSessionPrompt()ingestion-pipeline.tsdetectLanguage(), stored in metadataindex.tspackage.jsonbabel-memoryas optional dependencybabel-memory capabilities
detectLanguage()— 8 script systems (zh/ja/ko/th/ar/hi/ru/en)tokenizeForFts()— BM25 pre-tokenization for 27+ languagesgetKgPrompt()/getSessionPrompt()— bilingual LLM prompt templatesTest plan
🤖 Generated with Claude Code