Back to Case Studies
NL2SQLTiered RoutingReAct AgentFAISSEnterprise Analytics

Enterprise ChatBI / NL2SQL System

Built a ChatBI system for logistics analytics that replaced an unreliable pure-LLM path with tiered routing, guided clarification, retrieval, validation, and ReAct-style tool orchestration.

Problem & Constraints

Business users depended on data teams for routine analysis. A pure LLM-based SQL approach reached only 60% query accuracy because domain language, incomplete requests, schema complexity, and business metric definitions made direct generation unreliable.

Engineering Role

Built and redesigned the system around three execution tiers, integrated schema and business context, added few-shot retrieval, and orchestrated analytical tools for complex queries.

System Architecture

Intent RoutingRule TemplatesGuided ClarificationReAct AgentSQL Validation

Technical Approach

  • Used deterministic templates for high-frequency queries where rules reached 99% accuracy without an LLM
  • Added guided interaction to collect missing parameters before generating SQL
  • Built a six-tool ReAct path covering SQL execution, forecasting, anomaly detection, root-cause analysis, schema lookup, and FAISS retrieval
  • Integrated schema context, business definitions, and historical examples to improve grounding
  • Reserved the higher-latency agent path for complex analytical questions where reasoning added value

Production Impact

Improved query accuracy from 60% to 85% and reduced routine data-team workload by 90%, giving business users a more reliable path to self-service analytics.

What This Proves

Shows the ability to engineer reliable enterprise LLM applications by combining probabilistic reasoning with deterministic routing, tools, data context, and validation.

Ready to discuss role fit?

If this system maps to your AI engineering, enterprise delivery, data, or risk needs, reach out directly.