Skip to main content
AI / Analyticscompleted

AI-Based Natural Language ERP & eCommerce Analytics Engine

Deterministic NL-to-SQL business intelligence engine allowing enterprise ERP and eCommerce operators to query complex sales, inventory, and ledger metrics using conversational plain text.

Role: Lead AI Systems Engineer

System Context & Overview

Developed a hallucination-free Natural-Language-to-SQL (NL-to-SQL) analytics engine tailored for enterprise ERP and multi-vendor eCommerce systems. The platform allows C-level executives, operations teams, and warehouse managers to ask complex business questions in natural language and receive instant, validated SQL queries, tabular datasets, and interactive visual charts.

Operational Complexity & Constraints

Business stakeholders constantly require ad-hoc telemetry—sales velocity across regional warehouses, margin rollups, inventory aging—but are bottlenecked by engineering teams who must write custom queries and build one-off reporting screens.

Key Requirements & Invariants

  • Grounded database schema understanding with foreign-key relationship graphing.
  • Read-only execution guarantees with strict tenant data isolation and zero SQL injection risk.
  • Conversational follow-ups with query refinement and context retention.
  • Automated charting and KPI metric card synthesis.
  • Sub-second cached response times for recurrent executive inquiries.
Architectural Solution

Created a vector-indexed schema catalog storing table definitions, business semantics, and column aliases. When a user asks a question, the engine retrieves relevant table schemas, constructs a syntactically valid SQL query, verifies it through an AST parser, executes it against a read replica, and formats the output into interactive React charts.

Key Engineering Decisions

Strict AST Parsing & Read-Only Connection Sandboxing

Eliminated any possibility of destructive SQL statements (UPDATE/DELETE/DROP) or unauthorized table access by validating query syntax trees prior to execution.

UX & Workflow Thinking

Provided plain-language query explanations alongside SQL queries, exportable CSV/Excel reports, and one-click pin-to-dashboard capabilities.

Technical Challenges & Resolutions

Deliverables & Production Outcome

Eliminated 75% of ad-hoc reporting requests to engineering teams and accelerated business decision velocity across finance, procurement, and inventory operations.

Technologies & Architecture Tooling

PythonFastAPINL-to-SQLLaravelMySQLRedisVector EmbeddingsReactTailwind CSS

Related Systems & Case Studies