Grounded text-to-SQL · AI Agents
Natural Language Insights Engine
Point it at a CSV it has never seen and it works out the schema for itself — column roles, whether returns are present, the grain of a row, and a revenue expression derived rather than read from a column. No configuration, no code changes, nothing about any particular dataset baked in. A constrained ReAct agent queries DuckDB through a single guarded tool, reads the rows, and queries again until it can answer; it cannot leave the loop without either a successful query or an explicit refusal. Answers come back with the queries that produced them, their row counts and timings, the assumptions made, and a confidence — so an answer is something you can check rather than something you have to trust.
1 / 1
Highlights
- Handles an unseen CSV end-to-end: sniffs delimiter and dates, then infers roles, grain and a derived revenue expression
- Measured statistics and inferred meaning are kept apart — exact SQL for one, a single model call for the other, shown in a correctable schema panel
- Cannot answer without querying: an after-model hook counts real tool results and blocks any ungrounded answer
- Refusal is a tool call, so it is structured, logged and testable — 7 of 21 eval questions pass only by being refused
- SQL runs on a read-only connection behind parse checks, a row cap and a timeout; 25 attack strings are covered in the tests
Tech stack
- Python
- FastAPI
- LangChain
- DuckDB
- Gemini
- Docker