Repository navigation
The ontology agent writes labels and definitions in the documents' language, since an empty ontology has none to follow - #1468
Open
Schro-code wants to merge 1 commit into
Conversation
…nguage, since an empty ontology has none to follow Signed-off-by: Schro-code <78734653+Schro-code@users.noreply.github.com>
WaylandYang
requested changes
Oct 30, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks for finding this. 0004 decisions 3 and 5 make `kb.ontology_lang` the language of generated labels and descriptions, and the caller states it. The documents' language would ignore that setting on a base set to `zh` with English documents. Please take the alternative from #1467: pass the base's `ontology_lang` into the prompt, for labels and definitions, with keys staying ASCII. The stale `lang_name()` mention in 0004 decision 5 should be updated in the same PR.
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.
Why
Refs #1467. #1129 retired Suggest, and with it the only prompt that named a language for generated
label/description. The 0061 agent asks for "the language of the ontology", and that fails in two cases:Labels had no language rule at all. On one Spanish base, a single round left 183 class proposals, and about two thirds of them had English definitions.
What changes
One rule in the agent's system prompt (
crates/utopia-extract/src/ontology_agent.rs): labels and definitions are written in the language of the documents, meaning the phrases, kind words and quotes the prompt already carries, even where the ontology or the instructions use another.This is the rule
question_agent.rs:53already gives competency questions, which came out in Spanish on the same base. 0004 decision 3 says the description follows the corpus; this rule reads the corpus directly, so it holds for any language, including onesontology_langcannot store.Not in this PR:
ontology_langitself. That is the alternative in The ontology agent never reads a base's ontology_lang, so its labels and definitions come out in whichever language the model picks #1467, passing the value through alang_name(); it is a small follow-up if you prefer the setting to decide.signatures_already_proposedkeeps the agent from proposing a shape again.How it was checked
On macOS (arm64), on
dev@ 1d94b53:cargo fmt --all --check: clean.cargo clippy --locked --workspace --all-targets -- -D warnings: clean.cargo test --locked --workspace: 1421 passed, 0 failed, 3 ignored.UTOPIA_DATABASE_URLwas not set, so the store's SQL tests skipped; this change touches no SQL.The assertion added to
the_prompt_names_every_input_oncefails ondev, where the prompt says "language of the ontology".Not run against a model in this PR. The behaviour it fixes was observed on a fork running this agent unchanged (The ontology agent never reads a base's ontology_lang, so its labels and definitions come out in whichever language the model picks #1467).
Before review
git commit -s)cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspacepass