Building a Semantic Model for Recycling Contamination Triage
Description and use
ResidueDesk‑AI uses a semantic model to evaluate loads at a recycling facility, considering both numeric metrics and prohibited words in notes, and produces a priority brief for the shift.
Problem
Recycling facilities need to decide how to handle inbound loads when a numeric residue percent is low but a note contains a prohibited item, such as a battery pack, which should override the numeric assessment.
Outcome
On a sample of ten tickets, the brief reported 2 accepts, 4 resorts, 3 diverts, and 1 reject, with an average residue of 8.36%. The system correctly quarantined a load with a battery note despite a low residue percent.
Workflow
- Validate ticket with Pydantic
- Project ticket to semantic layer (Load, Commodity, Supplier, measures)
- Scout for prohibited words in note
- Grade load against commodity metrics (ResiduePercent, MoisturePercent caps)
- Route load to appropriate line (accept, resort, divert, quarantine)
- Generate shift brief sorted by severity
- Expose API via FastAPI and CLI via Rich
Evidence
I built ResidueDesk-AI, a personal experiment, so a laptop at a fictional scale house would quarantine that load instead of waving it onto a tip floor because the residue percent was low.
The PoC is a semantic model with a local coordinator on top. The model names three entities, Load, Commodity, and Supplier, and three measures on Load: NetWeightLb, ResiduePercent, and MoisturePercent.
On the ten sample tickets the brief lands at 2 accept, 4 resort, 3 divert, 1 reject, average residue 8.36 percent.
- Record date: 2026-10-15T04:41:08.360Z