Company running on an ERP
Plain-language questions to the ERP, with a guard before every query
A company wanted to query its ERP without waiting for custom reports. We built an agent that writes the query, passes four barriers and only then answers, on the portal and on WhatsApp.
Problem
Every new question became a request to the technical team. Giving the AI direct access to the database would clear the queue and create another risk: heavy queries locking the system, data outside the asker's permission and made-up answers that look like numbers.
Context
A company whose operation is recorded in an ERP. The data exists, but reaching it means knowing where to click or asking someone who knows for a report.
Solution
One validated tool
The agent has a single query tool. Everything it generates goes through it.
Four barriers before running
Restricted database permission, a list of what can be read (tables, columns and functions), validation of the query structure, and limits on time, rows, size and queries per question.
Business rules with a declared status
Each company rule is marked as inferred or confirmed, and the agent says which one it used in the answer.
WhatsApp with registered questions
On the portal, the agent writes the query. On WhatsApp, it answers registered questions. Out of scope, the refusal is fixed text, not something the model improvises.
No answer without a query
An answer with data requires a current query. The agent does not reuse a number or a date from an earlier message.
Transformation
The question that used to wait for a report is now asked in plain language. The answer comes from the ERP data, with the rule used in view. The technical team stops writing queries and starts managing what the agent can read.
Result: This case has no result figure: there is no measurement validated by the client yet. What we describe is the change in routine.
Who it is for
- Companies with reliable ERP data and a queue of report requests
- Managers who want to ask on WhatsApp without opening the system
- IT teams that need to audit what the AI queried
Who it is not for
- Anyone who wants the AI to write or change ERP data without confirmation
- Databases with nobody to say which business rule applies
- Anyone expecting answers about what is not recorded in the system
Technical detail
Validate the structure, not the text
The generated query is parsed into a syntax tree before it runs. If it breaks the policy, the agent gets the reason and writes it again. Database system variables are refused. And since the client timeout did not cancel the query on the server, a watchdog on another thread sends the cancellation: the server stops working and the connection stays usable.