iEnergy Digital · an AI agent for safety questions
I built an AI agent that answers an energy company's safety questions in under 3 seconds, work that used to take an analyst an afternoon. I built it with the safety officers who use it, and added a voice version in 30+ languages.
01The problem
The company had years of incident, hazard and audit records across 14 modules, stored as deeply nested data that only engineers could query. Every question from a safety officer meant waiting on an analyst for an afternoon. They wanted answers in seconds that they could still trust.
02What I built
An agent that can look up how the data is structured, run database queries and search records, taking up to 8 steps until it has an answer. It remembers its past mistakes and successes (92 reusable query patterns so far), so it gets more accurate with use. It charts every numeric answer as a line, bar or pie chart, and the screen shows each step as the agent works.
03How it works
For database questions it writes 3 queries at once and keeps the one with the best results. For questions about incident descriptions it combines keyword search, which catches exact equipment and site names, with meaning-based search, which catches different wording. Answers stream in, so the first words appear in about 2 seconds.
04A decision that mattered
The agent can only read the database, never change it. A tool that could edit a live safety database is too risky, so I left that ability out completely. Each organisation's data is also kept separate.
05How I tested it
I agreed an accuracy bar with the officers: 20 questions with known answers, checked every night against the live data, plus 121 automated tests. When it gets something wrong, I group similar mistakes and fix each group in the agent's memory, so it keeps improving.
06The voice version
This wasn't in the brief. I noticed officers on site couldn't stop to type, so I proposed a voice version and built it on Gemini Live, with Sarvam and OpenAI as backups. Officers talk to it in 30+ languages and can interrupt it any time, and every spoken answer comes from the same checked pipeline.
07Where it runs
On AWS EC2 with Docker, nginx and HTTPS. A health check runs every 5 minutes and restarts the service if it stops responding, and backups run nightly and are kept for 7 days. About 12,000 lines of Python.
08How it links to my other work
It follows the same rule as GUS: answers show their sources, and it would rather say it doesn't know than guess.