SouthCity AI Data Query Assistant

A role-aware Text-to-SQL assistant for a property ERP. Sales and management users ask questions in Indonesian and receive grounded reports with supporting tables, while a SQL AST policy and SQL Server permissions enforce read-only, role-scoped access.

Proof points

  • 50/50 Offline Evaluation Cases
  • 10/10 Deployed Demo Cases
  • 34 Red-Team Checks · 2 Gaps Documented

Technologies

Python, FastAPI, SQL Server, sqlglot, Role-Based Access Control, Vercel

Links

Problem

Property ERP users need reliable answers in Indonesian, with sales and management roles seeing only the records their access permits.

Approach

Built a FastAPI Text-to-SQL service that binds database logins to roles, uses an AST-level SQL policy and SQL Server permissions to block writes and out-of-role reads, and grounds rendered answers in executed result rows.

Results

The submitted evaluation records 50/50 cases on the final code and 10/10 on the deployed demo. The red-team report records 34 passed attacks or controls and documents two remaining gaps. The demo uses the assignment fixture; no production ERP integration is claimed.

SouthCity AI Data Query Assistant

A Text-to-SQL API and web interface for a property ERP on Microsoft SQL Server. The assistant accepts role-scoped Indonesian questions, resolves entities against the fixture, constructs bounded SELECT queries, and returns the supporting tables and SQL. A sqlglot AST allowlist and database permissions form separate read-only and role-access boundaries.

The repository reports a 50/50 final offline evaluation, a 10/10 evaluation against the deployed demo, and 34 red-team attacks or controls passed with zero failed and two documented gaps. The live service depends on an Azure SQL database that may pause when idle. The public repository includes the API, evaluation reports, threat analysis, and deployment setup.