Predictive Maintenance Agent: Faults and RUL
Turns a machine signal into a maintenance ticket: what is wrong, how sure we are, what to do, and by when. Physics and machine learning produce the numbers, an LLM agent writes the explanation, and code checks that every number came from a tool.
View the code on GitHubFull results
- recording accuracy on unseen operating loads (CWRU)
- 97.5%
- recording accuracy on unseen fault sizes, the harder test
- 87.2%
- RUL RMSE on 100 NASA C-MAPSS test engines
- 13.27

Problem
Unplanned failures are expensive, and vibration analysis needs a specialist to read it. Automation goes wrong in two ways: bearing datasets are easy to leak, so scores look better than they are (a random split here scores 100%), and language models invent numbers. A made-up deadline on a ticket is worse than no ticket.
Approach
- Fault diagnosis uses gradient boosting on time-domain and envelope spectrum features, tested on loads it has never seen.
- Remaining useful life uses gradient boosting on sensor statistics, with an 80% prediction interval from quantile models.
- A tool-calling agent writes the finding and recommended action; urgency, deadline and confidence are set by code.
- Code reviews the text for numbers, deadlines, bearing life claims and contradictions. A failed draft gets one retry, then the ticket is stamped UNVERIFIED.
- Remaining life is deliberately not estimated for bearings, because the data cannot support it.
Results
- How you test matters most: the same features and model score 100% on leaky random windows and 87.2% on unseen fault sizes.
- High-confidence labels were correct on every recording in both tests, 23 of 23 and 15 of 15, though the counts are small.
- The review caught 80 of 80 invented claims, but those came from ten fabrications I wrote myself, so it shows the check works on those patterns only.
- Eight live agent cases are a smoke test, not a benchmark.
Limitations
- CWRU is one rig with seeded faults, so expect lower accuracy on real machines.
- There are only four healthy recordings, and the one load-split error comes directly from that.
- C-MAPSS is simulated, and beyond about 125 cycles the model can only say healthy.
- The text review is pattern matching, so unusual wording can get past it. A person should approve interventions.
Built with
- Python
- scikit-learn
- NumPy
- SciPy
- pandas
- Streamlit
- Gemini
- Anthropic
- OpenAI