RETAIL
ERP AI Assistant for Read-Only Business Questions
An ERP assistant retrieved business figures in response to questions, with validation to restrict queries to read-only access.
Overview & Scope
The project embedded an analytics assistant in a US electronics brand's ERP. Managers can type or dictate questions about business data, including sales, receivables, orders and inventory.
Business Challenges
Managers depended on predefined reports for answers that often needed a new filter. Generating SQL also introduced a second problem. A query can look plausible while using an outdated field, a wrong join or an incorrect definition of a business metric.
Solution
Business definitions and schema. The assistant uses a data dictionary for tables, joins and business rules. The application checks the live schema and disables examples that no longer validate.
Read-only execution. GPT-4.1 proposes a query. Microsoft ScriptDom parses it and the application checks it against approved tables, fields and functions before SQL Server runs it. The answer uses the returned data.
Testing and traceability. A test harness checks SQL and answers against expected results. Queries and validation stages are recorded for review.
Technology stack. ASP.NET Core (.NET 8), Razor Pages, SQL Server, T-SQL, Microsoft ScriptDom, GPT-4.1 and browser speech APIs.
Documented Impact
The documented end-to-end evaluation recorded 599 passing questions out of 601. The assistant is in active use. That test result describes the specified evaluation, while the read-only validation applies to queries at runtime.


