Same question, same SQL, same answer
Deterministic Natural-Language Search for a Private-Markets Data Platform
Deal teams ask “industrials in the southwest received this year with LTV under 70%” and get an exact, explainable table — the model plans the query, but never writes free-form SQL.
The problem
A data platform for real estate and private-credit investors held deal metrics in a wide table — over a hundred columns — that only an analyst could query. Deal teams speak in vernacular (“LTV”, “multifamily”, “southwest”), the columns do not, and a text-to-SQL model that guesses a column or invents one returns a confident, wrong table.
What we built
A chat interface over the metrics database in which the language model never writes SQL directly. It interprets the question into a structured filter, deterministic code turns that filter into a validated, read-only query, and the answer comes back as a table with the filters it applied spelled out.
Before
- 100+ columns only an analyst can query
- Vernacular terms are not column names
- Text-to-SQL invents columns
How it works
Profile the database first. Every table and column is profiled automatically: type, null rate, cardinality, value ranges for numbers, top values for categories. The profile is checked against direct SQL so the agent reasons over facts, not guesses.
Teach it the vocabulary. A model writes a one-line description and a handful of synonyms for every column at temperature zero, so “loan amount” and “LTV” land on the right fields.
Retrieve before generating. A retrieval agent combines an entity index, vector search over the domain knowledge and fuzzy column and value matching (“york” → New York) into a summary of the tables, columns and intent the question needs.
Plan as JSON, not SQL. The model outputs a filter plan — fields, operators, values — validated against a schema. Unknown fields are rejected; an ambiguous term such as “price” triggers a clarifying question instead of a guess.
Build and check the SQL in code. A deterministic generator turns the plan into SQL, validates it against the schema, blocks anything that writes, and retries a failed validation at most twice.
Pick the model per job. Each component was benchmarked side by side on real columns: the larger model kept the description writing, where quality drives matching, and a model about 90% cheaper took over entity grouping, where it did as well or better.
After
Same question, same SQL, same answer
Stack
NL2SQLAI AgentReal EstatePrivate CreditWhy it holds up
Determinism is the product. The same question produces the same plan, the same SQL and the same rows, every query is logged with its parameters, and a column the model invents simply cannot reach the database. That is the bar a credit committee needs before it trusts a chat window over its own deal book.
Related service: Hire vetted AI engineers
More case studies
Big 4 client · fully on-premise
Enterprise RAG Chatbot for a Big 4 Accounting Firm
Multimodal retrieval over a Big 4 firm’s full compliance library, tuned for citation instead of summary — every answer arrives with its source paragraph attached.
- Juniors reading thousands of pages per question
- Seniors acting as search engines
200k calls/month · 67% booking rate vs 77% human
24/7 AI Agent Call Center: 200k Calls a Month Across 60 US HVAC Brands
Voice agents orchestrating 200,000 calls a month across 60 US HVAC brands for a 5,000-person enterprise, booking 67% of calls against 77% for human agents — within 10 points of a trained team, around the clock. Built as a product, an AI front desk that answers, books and routes, not a pilot.
- Night and weekend calls unanswered
- Staffing every shift hard to justify
US$1M collected in the first 3 months
AI Payment Collection and Reminders
The companion product to the AI front desk: it chases unpaid invoices with polite, timed reminders and a payment link, and stops the moment the customer pays or replies. It collected over US$1 million for the client in its first three months.
- Chasing payment is awkward and late
- Billable time lost to collections
Get started
Talk to the engineer who will build it.
You will speak with me directly. Bring the use case, the data and the constraints, and I will give you a straight view on feasibility, effort and the first thing to ship.
