Skip to content

Trim Step 1 (build ontology) prompts to need-to-know#62

Merged
cafzal merged 1 commit intomainfrom
runbook-step1-prompt-trims
May 8, 2026
Merged

Trim Step 1 (build ontology) prompts to need-to-know#62
cafzal merged 1 commit intomainfrom
runbook-step1-prompt-trims

Conversation

@cafzal
Copy link
Copy Markdown
Collaborator

@cafzal cafzal commented May 8, 2026

Why

The Step 1 prompts in each template's runbook.md enumerated every CSV in data/ (e.g. "…from the eight CSVs in data/: cell_towers, network_equipment, …"). That's noise — /rai-build-starter-ontology introspects data/ and picks concept shapes itself. The prompts read more like an instruction manual than what a user would type.

This PR trims them to need-to-know only: the destination (data/) and any modeling hint that's non-obvious from CSV inspection alone.

Changes

Template Hint kept Rationale
telco_network_recovery composite-key time-series (date+region) not visible from headers; agent could synthesize a surrogate id
energy_grid_planning (bare trim) every CSV maps 1:1 to a Concept, no surprises
supply_chain_resilience (bare trim) same
machine_maintenance introduce a Period Concept (1..N from period column) Period is synthesized from an integer column, not its own CSV
portfolio_balancing binary-property covariance (long-form (stock_i, stock_j, value)) + promote Sector to a Concept covariance is naturally a binary property on Stock; sector enums need to be Concepts so downstream rules can aggregate

Test plan

  • Static simulation — per-template subagents loaded the rai-build-starter-ontology skill, inspected CSV headers, and wrote out the PyRel ontology code an agent would produce from the trimmed prompt. All five concept sets match canonical.
  • Live canonical run — each template's main script (which builds the same ontology an agent would produce structurally) ran end-to-end against actual RAI: telco, energy, supply_chain, machine_maintenance, portfolio all exit 0 with their headline outputs matching the runbook (telco $4,956,843 / OPTIMAL / 12 GOLD / 2 SILVER / 1 BRONZE, machine_maintenance OEE 79.8/68.2/61.4, supply_chain baseline $1,865, etc.).
  • Live paste-test (supply_chain) — hand-wrote agent-style code from the trimmed prompt verbatim, ran against actual RAI. Concept set matches canonical (all 7). 5 of 7 concepts loaded with full row counts; Business (8/31) and Shipment (248/262) hit a NaN-row-dropping issue that the canonical script handles via batched loading. Not a trim regression — the original prompt didn't address this either; it's a runtime data-hygiene quirk an agent finds via 1-2 iteration cycles.

Conclusion: trims are safe. The agent generates equivalent loading code from either prompt form; the trim only removes redundant detail from the user's question.

Drop the file-by-file enumerations from Step 1 prompts — the agent
+ /rai-build-starter-ontology can introspect data/ and pick concept
shapes itself. Keep only the modeling hints that are non-obvious
from CSV inspection alone:

- telco: keep the composite-key time-series hint (date+region)
- energy: bare trim (every CSV maps cleanly to a Concept)
- supply_chain: bare trim
- machine_maintenance: keep the Period-concept hint (synthesized
  from an integer column, not its own CSV)
- portfolio: keep the binary-covariance hint (long-form covariance
  is a binary property on Stock, not a separate Concept) + the
  Sector promotion hint (so downstream rules can aggregate per
  sector)

Verified by per-template subagents that the tighter prompt + skill
+ data still lands on the canonical concept set.
@cafzal cafzal merged commit 983a61e into main May 8, 2026
1 of 2 checks passed
@cafzal cafzal deleted the runbook-step1-prompt-trims branch May 8, 2026 20:16
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