Reconcile -> Compare -> Flag -> Shortlist -> Notify
Yield and Mass-Balance Explainer
After each batch the agent reconciles what was charged in against what came out and what was lost, then compares the loss to the normal band for that product. When a batch falls outside the band, it flags it and shortlists likely causes such as high wash loss or filtration carryover. A process engineer reads the shortlist and decides what to investigate.
The Problem
The batch closed at 91 percent yield. Normal is 96. Nobody knows why yet.
A batch finishes and the numbers get logged: charged in, produced, sampled, discarded. On paper the yield looks low, but the reconciliation lives in three places and no one runs it until month-end. By the time a trend shows up in the yield report, six more batches of the same product have run. The likely cause, a wash step carrying product to drain, is still guesswork.
What Changes
Every batch reconciled and explained while the run is still fresh.
The agent pulls charge and output quantities the moment a batch closes, computes the full mass balance against theoretical yield, and compares the loss to the product's normal band. If the batch is outside the band it flags it and ranks the likely causes from the pattern of where mass went missing. The engineer gets a one-page explanation the same day, not at month-end.
Humans stay in control: the agent computes the balance and ranks candidate causes, and the process engineer decides what to investigate and whether a deviation is warranted.
HOW THE AGENT WORKS
HOW TO BUILD IT
Three levels of depth. Pick the one that matches where you are.
For the ops person who needs to understand what's involved and brief their team.
WHAT YOUR TEAM PROVIDES ONCE
- Mass balance - charged-in versus produced versus accounted loss per batch
- Theoretical yield check - actual output against the recipe target
- Loss band comparison - this batch against the product's historical range
- Normal or abnormal flag - a clear call on whether the batch is in band
- Likely-cause shortlist - ranked candidates like wash loss or filtration carryover
For the IT person or technical lead who needs to scope the integration.
INQUIRY SOURCES
WORKFLOW ENGINE (N8N)
CONNECTS TO
Without API access, someone exports the batch quantities and yield table to CSV after the run. The agent computes the same balance and emails the report. The trigger becomes a manual upload rather than an automatic batch-close event.
With API access to the MES and ERP, the agent reads batch quantities and yield targets on batch close and runs the reconciliation automatically. The engineer sees the explanation within minutes of the run ending. Best experience.
For the person who wants to build this agent step by step. Each node below maps to an n8n workflow node.
You are reconciling a chemical batch. Charged-in components: {charged_in}. Produced: {produced_kg} kg. Sampled: {sampled_kg} kg. Discarded: {discarded_kg} kg. Theoretical yield: {theoretical_yield_kg} kg. Normal loss band: {loss_band}. Compute total charged, accounted output, loss in kg and percent, yield percent, and whether loss is inside the band. Respond ONLY with valid JSON. No explanation.{"charged_in":[{"material":"API","kg":100},{"material":"solvent","kg":400}],"produced_kg":455,"sampled_kg":5,"discarded_kg":2,"theoretical_yield_kg":500,"loss_band":{"low_pct":2,"high_pct":6}}{"total_charged_kg":500,"accounted_kg":462,"loss_kg":38,"loss_pct":7.6,"yield_pct":91.0,"in_band":false}You are a process engineer assistant. A batch of {product_code} lost {loss_pct} percent, above its normal band of {loss_band}. Where mass was accounted: {balance}. Recent history for this product: {history_notes}. List the most likely causes of the extra loss, ranked, each with a short reason and where to check. Respond ONLY with valid JSON. No explanation.{"product_code":"CMP-204","loss_pct":7.6,"loss_band":{"low_pct":2,"high_pct":6},"balance":{"loss_kg":38},"history_notes":"wash volume increased last month"}{"causes":[{"rank":1,"cause":"high wash loss","reason":"wash volume was increased recently and product is soluble in the wash","check":"mother liquor and wash filtrate assay"},{"rank":2,"cause":"filtration carryover","reason":"fines passing the filter cloth","check":"filtrate clarity and cloth condition"}]}- Read quantities from one nightly export
- Reconcile balance for one product
- Compare loss to a fixed band
- Flag batches outside the band
- Email a one-page mass balance
- Engineer decides what to investigate
- =+ Live batch-close trigger from MES
- =+ Product-specific bands from rolling history
- =+ Component-level balance, not just totals
- =+ Cause shortlist tuned on past deviations
- =+ Trend yield and loss by product and line
- =+ Auto-draft deviation summary for engineer review
Full Video Walkthrough Coming Soon
Watch the agent reconcile a closed batch and return a mass balance with a ranked cause shortlist.
Register to be notifiedEverything on this page is free to learn.
When you're ready to build — do it yourself or bring us in.
OTHER AGENTS IN LEASING & MARKETING
Solvent Recovery Reuse Advisor
Shift Handover Draft Generator
Batch Record Right-First-Time Checker
Reactor Changeover and Cleaning-Level Advisor
Frequently asked questions
This is 5 of 5 agents in Production & Batch Manufacturing. → · Explore all 15 departments →