This project is discontinued - it's a demo. All data is fake and resets on refresh.
Querly
Mina Park
7 days ago
Force function-calling with the schema as a typed tool, then run a validation pass that parses the SQL and checks every table/column against the catalog. On failure, feed the exact error back for ONE repair retry. That combo took our invalid-query rate from ~15% to under 2%.
The single repair retry is the underrated part. Most hallucinations are fixed when you literally tell the model "column signup_source does not exist, valid columns are: ...". More than one retry is diminishing returns.
Schema retrieval is what saved us once we passed ~80 tables. Embed table descriptions, retrieve the top-k relevant tables for the question, only put those in context. Accuracy AND latency improved.
Plus one for retrieval. We also append a few real example rows per retrieved table - the model stops guessing enum values when it can see them.
Please make the validator also block anything that is not a SELECT by default. Saw a prompt-to-SQL demo cheerfully generate a DELETE last year. Read-only role on the DB connection too, belt and suspenders.