Plant Schematics Ingestion

Plant Schematics Ingestion

The Plants page (sidebar → Config → Plants) turns a plant's PDF diagrams — hydraulic/mechanical P&ID, electrical single-line schematics — into a structured, IEC 81346-aligned Markdown document that feeds classification context for that plant via the Plant Schema selector on the Classify and Classify Bulk pages.

Step 1 — Upload

  1. Type the plant's name (res_top_node) into the Plant field; existing plant names autocomplete as you type.
  2. Choose a PDF via Unifilar schema (PDF).
  3. Click Upload. The platform stages the file and shows you its filename, page count, and size for confirmation before moving it into that plant's folder (data/plant_schemas/<PLANT>/).

Step 2 — Parse with LLM

Click Parse with LLM. Under the hood:

  1. The PDF's text layer is extracted deterministically to get an authoritative list of every IEC code printed on the page.
  2. Each page is also rendered to a high-resolution image (200 DPI).
  3. A Claude agent receives both the code list and the page images, and reconstructs the IEC 81346 hierarchy by reading which codes are drawn inside which bordered boxes — i.e. it sees the diagram, not just the text. When a code is too small or unclear to read, the agent zooms into that region of the page itself (as many times as needed) instead of guessing; it also reads the platform's wiki through its own tools to ground each code's description, rather than a fixed set of pages chosen in advance.

The result is a Markdown document with two sections:

  • Section 1 — System Hierarchy: a nested bullet tree, Main System → Technical System → Component System, each entry showing its code, description, and parent.
  • Section 2 — Code Inventory: one table row per code — Code, Level, Parent Path, Description — i.e. the same hierarchy flattened for quick lookup.

Step 3 — Review and refine

The hierarchy in Section 1 opens in an integrated code editor so you can correct anything the model got wrong (a misread code, a wrong parent, a missing branch). A note above the editor reminds you: edits here only change Section 1 — click Refine with LLM afterwards to have the model regenerate Section 2 (the inventory) so it stays consistent with your corrected hierarchy. Nothing is written to disk until you click Save.

Click PDF to view the original schema alongside your edits — by default it opens full-screen, but toggling Split first makes it open side by side with the editor (PDF on the right, editor on the left) so you can read the diagram while correcting the hierarchy. If you want to discard everything and start over, Clear empties the editor (after a confirmation prompt); like any other edit, nothing is removed on disk until you click Save.

Step 4 — Normative verification

After parsing, a Section 5 — Verification is appended automatically, performed deterministically (no LLM involved) against IEC 81346 invariants:

  • Every code found in the PDF's text layer must also appear in the parsed result (otherwise it's listed as a missing code).
  • A BL0 code must have no parent.
  • A BL1 code must have a BL0 parent.

A status banner reads either "✅ No significant issues found" or "⚠️ Issues detected — review manually", with the specific missing codes or wrong-parent cases listed underneath. This check is informational, not blocking — you can still save a schema with flagged issues, but you should treat the flags as a manual-review checklist before relying on the schema during classification.

Once saved

A validated, saved schema becomes selectable in the Plant Schema multi-select on both the Classify and Classify Bulk pages, where it's injected as structural context for the LLM — and it's the document that gets updated by the inferred schema suggestions described in Learning from Corrections.