TencentDB-Agent-Memory icon indicating copy to clipboard operation
TencentDB-Agent-Memory copied to clipboard

Localization issue: Hardcoded Chinese prompts in L1/L2/L3 extraction layers

Open codxt opened this issue 6 months ago • 4 comments

Summary

The system prompts for scene extraction, persona generation, and L1 deduplication are currently hardcoded in Chinese within the source code. This causes the Gateway to generate Chinese filenames (e.g., 个人身份与安全偏好.md) and Chinese content within the memory blocks, even when the user is conversing in English and using a non-Chinese LLM provider.

Files Affected

  • src/core/prompts/scene-extraction.ts
  • src/core/prompts/persona-generation.ts
  • src/core/prompts/l1-dedup.ts

Impact

Non-Chinese speaking users find it difficult to manage or audit their memory files (scene blocks) as the metadata and categorization are not in their native language. This limits the project's accessibility for a global audience.

Suggested Resolution

  1. Prompt Externalization: Move the prompt templates out of the TypeScript files and into a dedicated prompts/ directory with support for multiple languages (e.g., zh.md, en.md).
  2. Configuration Support: Add a locale or language field to tdai-gateway.yaml (defaulting to zh) to allow users to switch the internal prompt language.
  3. English Templates: Provide English translations for the core extraction and synthesis prompts.

codxt avatar May 17 '26 19:05 codxt

Hi @codxt, thanks for the detailed report!

You're right — the extraction prompts are currently hardcoded in Chinese. This is a known limitation. We'll review internally and schedule a fix soon.

Maxwell-Code07 avatar May 18 '26 07:05 Maxwell-Code07

Got it! We will fix this in our next version.

Huang10q avatar May 19 '26 12:05 Huang10q

Thanks @codxt — fixed and shipping in the next release. The L1/L2/L3 prompts now adapt to the user's input language automatically (no locale config needed); JSON keys / file names / timestamps stay English as a stable contract. Will close once the release is out.

Xuruida avatar May 27 '26 09:05 Xuruida

Released in v0.3.6 🎉 Closing now — thanks again!

Xuruida avatar May 31 '26 16:05 Xuruida