Skip to content

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

@codxt

Description

@codxt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions