Version: 0.9.12
Problem: graphify label/cluster-only (with an LLM backend, e.g. claude-cli) names communities via label_communities() in llm.py. The prompt built in _label_batch_with_retry (llm.py, around line 2392) is a hardcoded English string with no language directive:
prompt = (
"You are naming clusters in a knowledge graph. For each community below, "
"return a concise 2-5 word plain-language name describing what it is about "
"(e.g. \"Order Management\", \"Payment Flow\", \"Auth Middleware\"). "
"Respond ONLY with a JSON object mapping the community id (as a string) to "
"its name - no prose, no markdown fences.\n\n" + "\n".join(batch_lines)
)
There is no CLI flag or environment variable to pin the output language (checked cli.py's label/cluster-only arg parsing and llm.py for any GRAPHIFY_* env var touching labeling — none exists; the only --lang flag in the codebase is unrelated, for export callflow-html's HTML chrome language).
Impact: for non-English codebases/teams, re-running label/cluster-only across sessions produces inconsistent label language — the same community gets named in English in one relabel pass and in the team's natural language (e.g. Portuguese) in another, since the model infers language ambiently from the sampled node-label lines rather than an explicit instruction. This makes diffing/comparing labels across reclusters noisy and forces manual normalization.
Suggestion: add an explicit language instruction to the labeling prompt, controllable via a --label-language/--lang flag on label/cluster-only (or a GRAPHIFY_LABEL_LANGUAGE env var), defaulting to the current unconstrained behavior for backward compatibility.
Happy to test a patch if useful.
Version: 0.9.12
Problem:
graphify label/cluster-only(with an LLM backend, e.g.claude-cli) names communities vialabel_communities()inllm.py. The prompt built in_label_batch_with_retry(llm.py, around line 2392) is a hardcoded English string with no language directive:There is no CLI flag or environment variable to pin the output language (checked
cli.py'slabel/cluster-onlyarg parsing andllm.pyfor anyGRAPHIFY_*env var touching labeling — none exists; the only--langflag in the codebase is unrelated, forexport callflow-html's HTML chrome language).Impact: for non-English codebases/teams, re-running
label/cluster-onlyacross sessions produces inconsistent label language — the same community gets named in English in one relabel pass and in the team's natural language (e.g. Portuguese) in another, since the model infers language ambiently from the sampled node-label lines rather than an explicit instruction. This makes diffing/comparing labels across reclusters noisy and forces manual normalization.Suggestion: add an explicit language instruction to the labeling prompt, controllable via a
--label-language/--langflag onlabel/cluster-only(or aGRAPHIFY_LABEL_LANGUAGEenv var), defaulting to the current unconstrained behavior for backward compatibility.Happy to test a patch if useful.