# Deterministic NL2SQL for a Private-Markets Data Platform | Super Cat

> Natural-language search over a 100+ column deal database where the model plans a validated JSON filter and code builds read-only SQL. No invented columns.

Source: https://www.super-cat.tech/portfolio/nl-query-private-markets  
Last modified: 2026-10-22

[← All case studies](https://www.super-cat.tech/portfolio)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. After: Same question, same SQL, same answer.Before

- 100+ columns only an analyst can query

- Vernacular terms are not column names

- Text-to-SQL invents columns

How it works

- 01 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.

- 02 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.

- 03 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.

- 04 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.

- 05 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.

- 06 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
NL2SQL AI Agent Real Estate Private Credit

## Why 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](https://www.super-cat.tech/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

Read the case → 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

Read the case → 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

Read the case →

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.

[Book a call](https://calendly.com/super-chain/catyung)Hong Kong & London time zones
