Skip to content

feat: strengthen ontology-edit guidance to reuse types over inventing#1466

Merged
Evanfeenstra merged 1 commit into
mainfrom
feat/ontology-reuse-guidance
Jul 12, 2026
Merged

feat: strengthen ontology-edit guidance to reuse types over inventing#1466
Evanfeenstra merged 1 commit into
mainfrom
feat/ontology-reuse-guidance

Conversation

@Evanfeenstra

Copy link
Copy Markdown
Collaborator

What

Follow-up to #1465. Tightens the ontology-editing guidance so the agent reuses existing types instead of inventing new ones out of thin air, and makes inspecting the current ontology a hard prerequisite before any schema write.

Changes

agent.ts — injected ONTOLOGY_EDIT_GUIDANCE:

  • Inspection is now a mandatory first step: never call a create/update/delete tool without having inspected the current schema (get_ontology, with graph_search as a fallback to see how a concept is already modeled).
  • Added a reuse-first decision procedure (ordered): match existing types by meaning (synonyms, plurals, broader/narrower terms — e.g. PodcastEpisode, IndividualPerson, OrgOrganization) → extend an existing type (add attribute/edge) → only create as a last resort, inheriting from the closest existing parent and justifying why.
  • Frames type-creation as a heavyweight, last-resort action and calls out near-duplicates as the thing to avoid.

toolsJarvis.tsontology_create_type / ontology_create_edge descriptions:

  • Strengthened the always-present tool text with the same "LAST RESORT / MUST inspect first / match on meaning / prefer extension" framing (defense-in-depth at call-time).

Autonomy note

Deliberately does not tell the agent to ask the user before creating a type — this keeps autonomous use viable. Callers can still prompt for confirmation if they want it. The separate destructive-op confirmation guardrail (delete type/edge, rename attribute) is unchanged.

Testing

  • tsc --noEmit clean

Make ontology inspection a hard prerequisite before any schema write and
add a reuse-first decision procedure so the agent matches concepts to
existing types by meaning (synonyms, plurals, broader/narrower terms)
rather than creating near-duplicate node/edge types out of thin air.
Reinforced in both the graph system prompt and the create tool
descriptions.
@Evanfeenstra Evanfeenstra merged commit 035cd57 into main Jul 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant