Problem
Business users at a retailer send small ad hoc questions about their own spreadsheets to analysts. Per the speaker, more than 80% of such requests are simple: aggregations, slices, top-N, shares, comparisons, trends. Analysts lose focus on large tasks, and users wait 1–2 days for an answer. Users want an exact answer over the whole table, so RAG over the file does not fit.
Example from the article: a user uploads a parquet file of receipts (25,088,374 rows) and asks which date had the largest total turnover. The agent returns the generated SQL, the result (27 December 2025) and a plain-language answer.
Solution in brief
A separate asynchronous service loads the uploaded table into PostgreSQL and runs an LLM agent of four parts: Generator, Executor, Judge and Responder. The LLM sees only the schema, metadata and the SQL result; the database does the computing. The Judge checks that the SQL matches the question.
Questions this case answers
- How to let non-technical users query their own uploaded tables in plain language and get exact answers without a semantic layer
- How to check that a generated query matches the user's intent with an LLM judge before returning the result
- How to let business users ask questions about their own uploaded tables in plain language and get exact answers
- How to build a text-to-SQL agent that scales horizontally and does not block the chat backend
Tools and methods
- Text-to-SQL generation — SQL from the question and table metadata, with retries
- LLM judge — checks the query and the answer against the question
- FastAPI + Celery (Redis broker) — asynchronous task API with horizontally scalable workers
- PostgreSQL — service tables and the loaded user tables
- S3 — hands files from the chat backend to the agent service
Google or a one-time email code. No password.
