THOR: Transformer Heuristics for On-Demand Retrieval
Isaac Shi, Zeyuan Li, Fan Liu, Wenli Wang, Lewei He, Yang Yang, Tianyu Shi

TL;DR
THOR is a secure, scalable Text-to-SQL system that transforms natural language questions into verified SQL queries with fault tolerance and schema awareness, enabling non-technical enterprise data access.
Contribution
It introduces a decoupled architecture with integrated self-correction and schema-aware query generation for reliable enterprise data retrieval.
Findings
Demonstrates reliable ad-hoc querying in finance, sales, and operations.
Ensures enterprise-grade safety with read-only and compliance guardrails.
Enables non-technical users to access live data with zero-SQL complexity.
Abstract
We introduce the THOR (Transformer Heuristics for On-Demand Retrieval) Module, designed and implemented by eSapiens, a secure, scalable engine that transforms natural-language questions into verified, read-only SQL analytics for enterprise databases. The Text-to-SQL module follows a decoupled orchestration/execution architecture: a Supervisor Agent routes queries, Schema Retrieval dynamically injects table and column metadata, and a SQL Generation Agent emits single-statement SELECT queries protected by a read-only guardrail. An integrated Self-Correction & Rating loop captures empty results, execution errors, or low-quality outputs and triggers up to five LLM-driven regeneration attempts. Finally, a Result Interpretation Agent produces concise, human-readable insights and hands raw rows to the Insight & Intelligence engine for visualization or forecasting. Smoke tests across finance,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsData Management and Algorithms · Web Data Mining and Analysis · Consumer Market Behavior and Pricing
