Skip to content

zh/reflect.py re-exports English prompt unlocalized — causes EN/CN code-mixing in episode narrative output #5

Description

@KarryViber

Summary

everalgo/user_memory/prompts/zh/reflect.py re-exports the English REFLECT_EPISODE_PROMPT / REFLECT_EPISODE_UPDATE_PROMPT verbatim, per its own docstring:

"""Chinese prompts for EpisodeReflector — re-exports English (language-neutral for now)."""

Unlike its sibling zh/* modules (profile.py, episode.py, atomic_fact.py, the parser prompts, etc.), which all ship dedicated Chinese-localized prompt text, reflect.py has no zh-specific instructions at all — the English prompt is used unmodified for Chinese-language input.

Observed impact

Running EpisodeReflector against 100%-Chinese episode input, the merged narrative it produces intermittently mixes English phrasing into an otherwise Chinese narrative — a single paraphrased sentence (e.g. a decision/status summary) can render half in Chinese and half in English within the same output, even though every source episode was pure Chinese. This is consistent with the English-only instruction text leaking style/language into generation, since neither REFLECT_EPISODE_PROMPT nor REFLECT_EPISODE_UPDATE_PROMPT contains any "respond in the input language" instruction.

Downstream, this makes reflected narratives unreliable to consume as a clean-language data source for CJK deployments (we ended up excluding this field from a downstream pipeline because of the mixing).

Comparison with the other zh re-export

everalgo/clustering/prompts/zh/cluster.py is the only other module in the tree that re-exports the English template, but it documents why that's fine:

"""Chinese clustering prompts — re-export of the English template.

The clustering LLM template is language-neutral: responses match the candidate corpus' language...
"""

reflect.py's "for now" phrasing reads as an acknowledged gap rather than the same kind of deliberate, verified design decision — which matches what we're observing empirically (unlike clustering output, reflect output does not reliably match the input language).

Suggested fix

Doesn't require a full Chinese translation of the prompt — a single added instruction to the shared English template (e.g. "Write the narrative in the same language as the input episodes.") should close the gap while preserving the existing language-neutral prompt design.

Environment

  • everalgo installed as a dependency of EverOS/evermem (pip show everalgo via the evermem venv)
  • Affected: everalgo.user_memory.reflect.EpisodeReflector (both full-merge and incremental-update code paths)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions