Teaching AI to Audit What's NOT in Your FM Database
A year ago, Praecipua started a quiet experiment: Could a local, private AI actually handle the 100+ tables in a large facility management database?
The outcome? Today, I ran 47 complex facility queries—from occupancy gaps to maintenance backlogs—in under 6 minutes. Without this automation, those same questions would take 2-3 days of digging and double-checking.
🛡️ Why Standard AI Fails Enterprise FM
After over a decade of managing chatbot syntax, I’ve learned that AI usually struggles with rigid database structures. To test my theory, I began training a local model using a set of fake test data I built specifically to stress-test these types of systems.
Early on, I hit a wall. I asked the AI to "Find all employees in BLDG-01." It failed immediately. Why? Because most AI expects simple spreadsheet logic.
The Analogy: These systems are like hotels. You can’t just say "Find the guest in Room 101." Every building has a Room 101. To find the right person, the AI has to check the Building + Floor + Room all at once.
Here’s what that looks like under the hood: These are called Composite Keys. I used my background in syntax logic to teach the AI this Triple-Handshake connection. Now, it handles these joins every single time.
🧠 12 Months of Working with the Model
Using Gemma 3 4B and SQL Express via LM Studio, I went through four stages to get this right:
- The Syntax Phase: Teaching the AI that these systems use specific dialects (like the mandatory schema prefixes).
- The Error-Recovery Phase: I built a Python loop that catches SQL errors and feeds them back to the AI. If it guesses a column name wrong, the system catches the mistake and asks the AI for a fix—no manual debugging needed.
- The Metadata Phase: This changed everything. Before answering, the AI now checks the system's own "instruction manual" (the metadata tables) to see which columns actually exist for that specific query.
- The Negative Space Phase: This was the breakthrough. I taught the AI to look for what is NOT in the database. It can now find buildings with no recent work orders or equipment that is overdue for service because there's no record of a visit.
🔍 Beyond Queries
The most interesting part was watching the AI look at my test data and point out problems I hadn't even asked about. It noticed things like department codes that didn't match between people and their rooms, and ghost spaces that were active in one table but closed in another. It didn't just give me data; it checked if the data actually made sense.
📈 The Results
The change was huge: Day 1, the AI failed 90% of the time. Today, in my test environment, it hits 98% accuracy on standard facility questions. Joins that used to take me 20 minutes to write by hand now run in 4 seconds. Because it all runs locally, no building or employee data ever leaves my own network.
🚀 Let's Connect
I am currently Open to Work and looking for my next role in Facility Management, PropTech, or Data Strategy. I enjoy bridging the gap between old-school enterprise systems and new AI tools.