AI & Automation5 min readNetray Engineering Team

Natural Language Reporting Over Your ERP: A Practical Guide

Natural language reporting lets a planner or executive ask a question in plain English and get a correct answer pulled from live ERP data, without waiting for IT to build a report or opening a report writer nobody remembers how to use. It sounds simple and is genuinely hard to build safely, because raw text-to-SQL against a production SyteLine or Infor LN schema will confidently generate a query that joins the wrong tables, ignores a security filter, or double-counts a quantity across sites. The systems that work in production combine a semantic layer, a constrained query generation approach, and explicit guardrails rather than pointing a language model directly at your database and hoping.

Why Raw Text-to-SQL Fails on Real ERP Schemas

A production ERP schema has hundreds of tables, cryptic column names, and business logic that lives partly in the database and partly in application code the model never sees. Ask a raw text-to-SQL system for past due orders and it might join on the wrong date field, forget to exclude cancelled lines, or ignore that past due means something different for a make-to-stock item than a make-to-order item in your specific configuration. These errors are worse than a crash because the query runs successfully and returns a plausible-looking wrong number. Any production natural language reporting system needs a layer between the question and the database that encodes exactly this kind of business context.

The Semantic Layer Pattern That Actually Works

Instead of letting the model write arbitrary SQL against raw tables, define a curated set of business metrics and dimensions, each mapped explicitly to the correct joins, filters, and calculations for your ERP instance. Past due orders becomes a named, tested query definition rather than something regenerated fresh every time a user asks. The model's job shrinks to matching a natural language question to the right metric and dimension combination, which is a much more reliable task than generating correct SQL from scratch against an unfamiliar schema. This also means a metric definition only needs review once, by someone who actually understands your SyteLine or LN configuration, rather than being silently re-derived and potentially wrong on every query.

  • Curated metric and dimension definitions reviewed once by someone who knows your ERP configuration
  • Model matches questions to defined metrics rather than generating arbitrary SQL from scratch
  • New metrics added deliberately through a review process, not invented ad hoc by the model
  • Definitions versioned alongside ERP schema changes so an upgrade cannot silently break a report

Guardrails: Row-Level Security, Query Limits, and Confidence

Enforce the same row-level security the ERP already applies, so a natural language query cannot return data a user would not see in the SyteLine or LN client itself; this typically means executing generated queries under the user's own scoped credentials rather than a shared service account. Cap result size and query complexity to prevent an ambiguous question from triggering a full-table scan against a production system during business hours. Have the system state its confidence and show the underlying metric definition alongside the answer, so a finance or operations user can verify what past due order actually meant in that specific answer rather than trusting a number with no visible logic behind it.

  • Execute queries under the requesting user's own ERP-scoped permissions, not a shared admin account
  • Cap query complexity and result size to protect production ERP performance during business hours
  • Show the underlying metric definition alongside every answer so users can verify the logic
  • Log every question and generated query for review, since this is your evaluation set for tuning

Handling Ambiguous Questions Without Guessing

Real users ask ambiguous questions. Sales by region could mean bookings or shipments, this month could mean calendar or fiscal, and by region could map to a dozen different territory hierarchies depending on which report someone learned from years ago. A well-built system asks a clarifying question or shows its assumed interpretation before running the query, rather than picking one silently and returning a number that looks authoritative. This single behavior, surfacing the assumption instead of hiding it, is what separates a natural language reporting tool people trust from one they quietly stop using after being burned once by a wrong silent interpretation.

How Netray Builds Natural Language Reporting on ERP

Netray builds the semantic layer first, working directly with your finance and operations teams to define what each metric actually means in your SyteLine, Infor LN, or M3 instance, before any natural language interface goes live. Our ERPray product is built on exactly this pattern: ask your ERP anything, and get an answer grounded in reviewed metric definitions and your own row-level security, not a raw SQL guess against tables the model has never seen documented. We log every question for continuous tuning and give your team ownership of the metric library, so the system gets more accurate the longer it runs rather than drifting.

Frequently Asked Questions

Is text-to-SQL safe to run directly against a production ERP database?

Not without significant guardrails. Raw text-to-SQL against a production ERP schema can generate queries that join the wrong tables, miss a security filter, or misinterpret ambiguous business terms, all while returning a plausible-looking answer. Production systems use a curated semantic layer of reviewed metric definitions, execute queries under the user's own scoped permissions, and cap query complexity to protect performance.

How do you handle ambiguous questions in natural language ERP reporting?

The system should surface its assumed interpretation, such as which date field or territory hierarchy it used, rather than silently picking one and returning a number with no visible logic. For genuinely ambiguous questions, asking a clarifying question before running the query is far better than guessing. Users lose trust quickly after one silent misinterpretation, so transparency about the assumption matters more than always answering immediately.

What is a semantic layer in natural language ERP reporting?

A semantic layer is a curated set of business metrics and dimensions, each mapped explicitly to the correct database joins, filters, and calculations for your specific ERP configuration. Instead of generating SQL from scratch for every question, the natural language system matches questions to these reviewed definitions, which is far more reliable and lets someone who understands your ERP review the logic once instead of trusting a fresh guess each time.

Key Takeaways

  • 1Why Raw Text-to-SQL Fails on Real ERP Schemas: A production ERP schema has hundreds of tables, cryptic column names, and business logic that lives partly in the database and partly in application code the model never sees. Ask a raw text-to-SQL system for past due orders and it might join on the wrong date field, forget to exclude cancelled lines, or ignore that past due means something different for a make-to-stock item than a make-to-order item in your specific configuration.
  • 2The Semantic Layer Pattern That Actually Works: Instead of letting the model write arbitrary SQL against raw tables, define a curated set of business metrics and dimensions, each mapped explicitly to the correct joins, filters, and calculations for your ERP instance. Past due orders becomes a named, tested query definition rather than something regenerated fresh every time a user asks.
  • 3Guardrails: Row-Level Security, Query Limits, and Confidence: Enforce the same row-level security the ERP already applies, so a natural language query cannot return data a user would not see in the SyteLine or LN client itself; this typically means executing generated queries under the user's own scoped credentials rather than a shared service account. Cap result size and query complexity to prevent an ambiguous question from triggering a full-table scan against a production system during business hours.

Want your team asking your ERP questions in plain language and trusting the answer? Netray builds the semantic layer and guardrails ERPray runs on, tailored to your instance.