Developers

The mill, as an API

Define agents, declare policy, subscribe to runs and mirror everything into your MES. Nothing about the platform is only available in the UI.

  • Python + TypeScript
  • Streaming events
  • Policy as code

Define it in code

Policy is a first-class object

Autonomy level, approval conditions, setpoint envelopes and revert conditions are declared alongside the agent, reviewable in a pull request, not buried in a settings page.

define_dye_agent.py
# Define a bounded dye-control workflow
from yarneon import Mill, Agent, Policy, tools

mill = Mill("mill-02")

dye = Agent(
    name="dye-and-color",
    tools=[
        tools.spectro.read_bath,
        tools.colour.predict_recipe,
        tools.plc.dose(machine="jet-07", mode="bounded"),
    ],
    policy=Policy(
        autonomy="assist",                  # observe | assist | auto
        approve_if="recipe_deviation > 0.05",
        setpoint_limits={"temp_c": (30, 98), "ph": (4.0, 11.5)},
        revert_on="operator_manual",
    ),
)

run = mill.run(dye, goal="lot DL-4471 to 19-4028 TCX, dE <= 0.8")
for step in run.stream():
    print(step.name, step.status, step.duration_ms)
mirror_runs.ts
// Subscribe to run events and mirror them into your MES
const stream = await yarneon.runs.subscribe({
  mill: "mill-02",
  events: ["step.completed", "approval.requested", "defect.detected"]
});

for await (const event of stream) {
  if (event.type === "approval.requested") {
    await mes.raiseApproval({
      lot: event.run.lot,
      reason: event.policy.reason,     // "recipe_deviation 7.2%"
      revertTo: event.policy.lastKnownGood
    });
  }
}

Command line

Start a run from anywhere

The same run, from a terminal. Output is real text, streamed as the mill works, and identical to what the console and the audit log record.

yarneon cli · mill-02
$ yarneon run --mill mill-02 --lot DL-4471 --goal "19-4028 TCX, dE<=0.8"
  resolved 14 rolls · 3,180 kg · 40s combed cotton poplin
  twin.simulate      ✓  46.0s   best candidate dE 0.52
  dye.predict_recipe ✓   2.4s   Navy RGB 2.14% · Blue BRF 0.61%
  human.approve      !   4m12s  approved by colourist
  dye.control_bath   ✓ 118m00s  exhaustion 96.4%
  inspect.scan_rolls ✕  38m00s  WEFT_STREAK roll 09 · 412–445 m
  plan.rework_route  ✓   1.6s   33 m to seconds · ship date held
  quality.release    ✓   3.0s   13 Grade A · 1 Grade B
  
  run RUN-4471 complete · mean dE 0.58 · seconds 0.22% · 1 human decision

Also available as

  • Python and TypeScript SDKs with typed tool schemas
  • REST and streaming event APIs for MES and ERP mirroring
  • Webhooks for approvals, defects and releases
  • The command palette (⌘K) inside the Yarneon console
  • An on-HMI panel at the machine, for operators who never open a laptop

API surface

What you can call

Core API resources
ResourcePurpose
POST /v1/runsStart a run against a lot, line or work order.
GET /v1/runs/:id/eventsServer-sent stream of steps, tool calls and status changes.
POST /v1/approvals/:idApprove or reject a gated action, with attribution.
GET /v1/rolls/:idRoll genealogy, defect map and conformance state.
POST /v1/twin/simulateCounterfactual simulation against the as-produced twin.
GET /v1/policiesCurrent autonomy ceilings and setpoint envelopes.
POST /v1/webhooksSubscribe to approvals, defects, holds and releases.

Tool-call stream

Every call the agent made, in order

Machines, spectrophotometers, the optimiser and the humans are all tools. Calls go out, results come back, and the whole exchange is real, copyable text, the same record your auditor sees.

tool-call stream · RUN-4471
04:02:11 result: mes.get_lot("DL-4471") → 14 rolls · 3,180 kg · poplin 40s SUCCEEDED
04:02:12 call: twin.simulate(recipe_candidates=3, machine="jet-07") RUNNING
04:02:58 result: twin.simulate → best ΔE 0.52 · cycle 118 min · water 46 L/kg SUCCEEDED
04:03:01 call: colour.predict_recipe(substrate="cotton", standard="19-4028 TCX") RUNNING
04:03:03 result: colour.predict_recipe → Navy RGB 2.14% · Blue BRF 0.61% · Black B 0.08% SUCCEEDED
04:03:04 call: policy.check(action="dose", deviation=7.2%) → requires human approval APPROVAL
04:18:22 result: human.approve(user="colourist-on-shift", decision="approve", note="ok, hold ramp") SUCCEEDED
04:18:24 call: plc.dose(machine="jet-07", schedule="ramp-B") RUNNING
05:41:07 result: spectro.read(bath) → exhaustion 96.4% · bath ΔE 0.41 SUCCEEDED
06:22:40 result: vision.scan(roll=09) → WEFT_STREAK 412–445 m · severity 3 FAILED
06:22:41 call: cuopt.replan(cut_plan, constraint="ship_thu_0600") RUNNING
06:22:43 result: cuopt.replan → 33 m to seconds · ship date held SUCCEEDED
06:25:02 result: quality.release(lot="DL-4471") → 13 Grade A · 1 Grade B · packet signed SUCCEEDED

Guardrail in action

policy.check → requires human approval

At 04:03:04 the proposed recipe deviated 7.2% from the standing card, above the 5% autonomy ceiling for dye dosing at this mill. The agent stopped and asked. Fifteen minutes later a colourist approved it, and that approval is attributed, timestamped and reversible.

APPROVAL GATEAPPROVED 04:18

Failure handled honestly

vision.scan → WEFT_STREAK, roll 09

A 33 m weft streak is a real defect, and the run shows it as failed rather than smoothing it over. The mechanical root cause, a stenter pin-chain slip, was correlated automatically and raised as a work order.

STEP FAILEDRUN RECOVERED

Agent graph

One run, ten steps, one human decision

This is the shape of a dye lot on Yarneon, shown as an illustrative scenario rather than a customer run. Ingest and simulation fan out, converge on a colourist approval gate, then dosing, verification, finishing, inspection and release. The accent traces the active path; every node opens in the inspector.

RUN-4471 10 steps · 1 approval gate · 1 recovered failure · illustrative scenario COMPLETE
ingest conformance twin simulate recipe dye + colour approve human gate dose bath control shade verify ΔE finish stenter inspect vision rework replan grade release

Scroll the graph sideways · or open the text equivalent below

SUCCEEDED APPROVAL FAILED RUNNING
Text equivalent, workflow steps, dependencies and status
Run RUN-4471 workflow graph, as a table
StepStageDepends on StatusDuration
ingestconformancenone SUCCEEDED0.8s
twinsimulateingest SUCCEEDED46s
recipedye + colouringest SUCCEEDED2.4s
approvehuman gatetwin, recipe APPROVAL4m 12s
dosebath controlapprove SUCCEEDED118m
shadeverify ΔEdose SUCCEEDED9.1s
finishstenterdose SUCCEEDED64m
inspectvisionshade, finish FAILED38m
reworkreplaninspect SUCCEEDED1.6s
gradereleaserework SUCCEEDED3.0s
  • Parallel branches2twin simulation and recipe prediction run together
  • Human gates1colourist approval, 15 minutes, attributed
  • Failures recovered1weft streak on roll 09, replanned in-run

Run timeline

RUN-4471 · Indigo poplin, 3,180 kg, due Thursday

The same scenario run as an ordered timeline: step, status, duration and the tool result behind it. Inspection failed on one roll, the run recovered, replanned the cut and still held the ship date.

RUN-4471 RUN COMPLETE Scenario mill · reactive exhaust jet dyeing · illustrative run, not a customer deployment

Goal: Dye lot DL-4471 · 3,180 kg · 40s combed cotton poplin · shade Indigo 19-4028 TCX · ΔE ≤ 0.8 · due Thu 06:00

  1. 01 ingest.lot_state SUCCEEDED 0.8s

    Pulls greige genealogy for 14 rolls: yarn lots, loom, greige GSM 138, absorbency and residual size from the prep line.

    Agent, input and output
    agent   Quality-and-Conformance
    result  ← 14 rolls · 3,180 kg · mean GSM 138.2 (σ 1.1) · prep OK
  2. 02 twin.simulate_lot SUCCEEDED 46s

    Omniverse fabric-line twin simulates the exhaust curve, machine loading and takt for three candidate recipes before a drop of dye is used.

    Agent, input and output
    agent   Yield-and-Takt
    result  ← 3 candidates scored · best predicted ΔE 0.52 · 118 min cycle
  3. 03 dye.predict_recipe SUCCEEDED 2.4s

    Spectral recipe model proposes a 3-dye combination against the buyer standard, corrected for this substrate’s absorbency and the current water hardness.

    Agent, input and output
    agent   Dye-and-Color
    result  ← 2.14% Navy RGB · 0.61% Blue BRF · 0.08% Black B · salt 62 g/L
  4. 04 human.approve_recipe APPROVAL 4m 12s

    Recipe deviates >5% from the standing card, so autonomy is capped: the colourist approves, rejects or edits before any dosing. Guardrail policy MILL-02/DYE-APPROVAL.

    Agent, input and output
    agent   Dye-and-Color
    result  → awaiting colourist · approved on shift 04:18
  5. 05 dye.control_bath SUCCEEDED 118m

    Closed-loop dosing and ramp control against live bath spectrophotometry; two mid-cycle corrections applied when exhaustion ran 4% ahead of model.

    Agent, input and output
    agent   Dye-and-Color
    result  ← exhaust 96.4% · 2 corrections · bath ΔE 0.41 at drain
  6. 06 shade.verify_lot SUCCEEDED 9.1s

    Per-roll spectral read against Indigo 19-4028 TCX under D65/TL84/A; metamerism scored and rolls sorted into shade bands.

    Agent, input and output
    agent   Shade-and-Quality
    result  ← mean ΔE 0.58 · 13 rolls band A · 1 roll band B
  7. 07 finish.control_stenter SUCCEEDED 64m

    Stenter chemistry, overfeed and curing profile set to hold hand, 148 cm width and residual shrinkage under 3%.

    Agent, input and output
    agent   Finish-and-Hand
    result  ← width 148.3 cm · shrink 2.1% warp / 1.4% weft
  8. 08 inspect.scan_rolls FAILED 38m

    In-line vision flags a recurring 6 cm weft streak on roll 09 between 412 m and 445 m, traced to a stenter pin-chain slip, not a dye fault.

    Agent, input and output
    agent   Defect-and-Inspect
    result  ← 1 defect cluster · roll 09 · 33 m affected · class WEFT_STREAK
  9. 09 plan.rework_route SUCCEEDED 1.6s

    cuOpt re-plans the cut and rework route: 33 m diverted to seconds, remaining 14,890 m re-sequenced so the buyer’s Thursday ship date still holds.

    Agent, input and output
    agent   Yield-and-Takt
    result  ← 33 m to seconds (0.22%) · ship date held
  10. 10 quality.grade_and_release SUCCEEDED 3.0s

    Four-point grading, roll genealogy and the conformance packet (AATCC 61, ISO 105-C06, ZDHC MRSL declaration) are assembled and released to the buyer portal.

    Agent, input and output
    agent   Quality-and-Conformance
    result  ← 13 rolls Grade A · 1 roll Grade B · packet signed
RUN OUTCOME

Lot released first time, on shade, on date.

Result of run RUN-4471
MeasureValueContext
Final mean ΔE0.58against a 0.80 tolerance
Re-dyes avoided1the standing card would have missed shade
Seconds0.22%versus the scenario mill baseline of 1.9%
Water used46 L/kgversus 59 L/kg on the scenario recipe card
Human decisions1the recipe approval gate

Why this matters

A mill does not fail on the good lots. It fails on the lot where the substrate drifted, the recipe card was wrong, and nobody found out until the buyer opened the carton. Yarneon makes that lot legible while it is still in the machine.

Reasoning trace

The reasoning, written down

Goal, observation, plan, action, decision, handoff, outcome. A colourist can read this and disagree with it, which is the point. Autonomy a mill cannot argue with is autonomy a mill will not adopt.

  1. Goal01 / 10

    Land DL-4471 on Indigo 19-4028 TCX within ΔE 0.80, first time, before the Thursday 06:00 ship cut-off.

  2. Observation02 / 10

    Greige absorbency for this lot reads 8% above the card baseline, and incoming water hardness is 142 ppm, both push the exhaust curve faster than the standing recipe assumes.

  3. Plan03 / 10

    Simulate three recipes in the fabric twin before committing dye. Prefer the candidate with the lowest predicted ΔE that also fits the 118-minute machine slot.

  4. Action04 / 10

    twin.simulate(recipe_candidates=3, machine="jet-07")

  5. Observation05 / 10

    Candidate B predicts ΔE 0.52 and finishes 6 minutes inside the slot. Candidates A and C either overshoot shade or miss takt.

  6. Decision06 / 10

    Candidate B deviates 7.2% from the standing card, above the 5% autonomy ceiling for dye dosing. Escalate to the colourist rather than act.

  7. Handoff07 / 10

    Dye-and-Color → the colourist on shift, with the simulated curve, the deviation reason and a one-click revert attached.

  8. Action08 / 10

    plc.dose(machine="jet-07", schedule="ramp-B") after approval, with two mid-cycle corrections when exhaustion led the model by 4%.

  9. Observation09 / 10

    Vision flags a 33 m weft streak on roll 09 after finishing. Correlating stenter telemetry shows a pin-chain slip at 04:51, a mechanical cause, not a dye fault.

  10. Outcome10 / 10

    Lot released at mean ΔE 0.58 with 0.22% seconds. A maintenance work order is raised against the stenter pin chain, and the streak signature is added to the mill’s defect memory.

Human in the loop

Craft is captured, not replaced

Textile mills run on scarce craft: the colourist who knows this jet runs hot, the weaving master who hears a beam going wrong. That knowledge is retiring faster than it is being replaced.

Yarneon writes it down. Every approval, override and correction becomes per-mill memory scoped to your tenant, so the mill keeps improving after the person who taught it has gone home.

  • Per-colourist and per-operator performance memory
  • Overrides captured as training signal, not noise
  • Versioned memory, scoped per tenant, never shared across mills

Conventions

How the SDKs behave

Idempotency

Safe retries

Every mutating call takes an idempotency key. A retried dose instruction never doses twice.

Typed tools

Schemas first

Tools declare typed inputs and outputs; the agent cannot call a machine with an out-of-range argument.

Backpressure

Streams

Event streams resume from a cursor, so an MES that fell over does not lose a shift of history.

Versioning

Dated

API versions are date-pinned per key. Breaking changes never arrive on their own.

Errors

Actionable

Errors name the policy, the envelope or the machine that refused, not a generic 400.

Local dev

Simulator

A mill simulator ships with the SDK so you can develop against a virtual line.

Guardrails

An agent earns the right to touch a machine

Nothing here is a global "AI on" switch. Autonomy is granted per setpoint, bounded by policy, reversible by any operator and logged permanently.

Graduated autonomy
Every workflow moves observe → assist → bounded auto-control. Autonomy ceilings are per-setpoint policy, not a global switch.
Human-in-the-loop gates
Approval gates fire on deviation thresholds, new substrates, or any action outside the authorised envelope. Approvals are attributed and time-stamped.
Reversibility
Every control action ships with a revert path and a last-known-good setpoint. Operators can take manual control at any moment, from the HMI or the panel.
Immutable audit log
Assurance-grade, append-only record of every observation, decision, tool call, approval and actuation, exportable for buyer and regulatory audit.
Tenant isolation
Recipes, construction libraries and roll data are isolated per tenant. No cross-tenant training. Permission-aware retrieval with enforced citations.
Sandboxed tools
Agents call machines through a typed, scoped tool layer with rate and range limits. There is no path from a model output to an unbounded PLC write.

Integrations

It speaks to the machines you already own

Yarneon is not a rip-and-replace. It connects to the looms, frames, jets, stenters, cameras, spectrophotometers and MES already on your floor.

Loom & knit controllers

Picanol, Toyota, Tsudakoma, Karl Mayer and Mayer & Cie controllers over OPC UA and vendor PLC tags.

Spinning frames

Rieter, Trützschler, Saurer and Murata frames, draft, twist, speed and end-break telemetry.

Dyeing & finishing

Thies, Fongs, Brazzoli jets and Monforts/Brückner stenters via PLC, recipe systems and dosing units.

Colour & lab

Datacolor and X-Rite spectrophotometers, colour libraries, Pantone TCX standards and lab-dip workflows.

Inspection hardware

Line-scan RGB and NIR cameras, Uster and Elbit inspection frames, existing light boxes.

MES / ERP

SAP, Datatex, TIM, Coats Digital and homegrown mill MES over REST, files and database CDC.

Utilities & sustainability

Water, steam and electricity meters; ZDHC Gateway, Higg FEM and OEKO-TEX reporting.

Robotics

Vision-guided manipulators and AMRs on NVIDIA Isaac and Jetson for doffing, beams and roll transport.

Vendor names are listed for compatibility reference only and do not imply endorsement or partnership.

Operating figures

The numbers a mill manager asks about second

Latency targets, connector coverage, autonomy modes and the record: the practical questions after the headline.

<100 ms

Design target for a per-frame inspection decision on Jetson-class edge hardware. ASPIRATIONAL

8

Connector families: looms, frames, dyeing, colour, inspection, MES, utilities, robotics.

3

Autonomy modes: observe, assist, bounded control. Granted per setpoint.

1

Record per mill: append-only, exportable, shared with buyers on request.

Items marked ASPIRATIONAL are design targets ahead of production validation.

Questions

What mills ask before they let an agent near a jet

Both, in that order. Every workflow starts in observe mode, graduates to assist (the agent proposes, a human commits), and only then to bounded auto-control on the specific setpoints you authorise. Autonomy ceilings, approval gates and spend limits are policy objects you own, and every action is reversible and logged.

Build against a virtual mill first

The simulator gives you a full line, a defect stream and an approval gate without touching production.

Book a mill assessment