The Problem
A real-estate business sat on a rich database of contacts, enquiries, property owners, and listings — but every question required an engineer to write SQL.
Staff wanted to ask questions conversationally without learning SQL, while the business needed absolute guarantees that no user could read another user's data, modify records, or probe the database structure.
Our Solution
We built a natural-language-to-SQL assistant that turns plain-English questions into safe, correct database queries.
How it works
- The assistant generates dialect-correct SQL, executes it, inspects the results, and self-corrects failed queries before answering.
- Dynamic few-shot prompting selects the most relevant example questions for each query using semantic similarity, keeping generated SQL accurate.
- A vector store adds retrieval context for richer answers.
Security built into the prompt
Every query is enforced to be read-only, scoped to the requesting user's own rows, and limited to an approved set of tables. The assistant refuses questions about database structure and never leaks internal identifiers.
Deploy anywhere
We delivered two interchangeable backends — a hosted model for maximum quality and a fully self-hosted option with local models and embeddings for on-premise privacy.
Outcome
Non-technical staff query live business data by simply asking, and get accurate, safe answers in seconds — with hard guardrails guaranteeing every response stays read-only and scoped to the right user.
Tools & Technologies
Build something similar
Start with a free requirements assessment — we'll tell you exactly what's achievable.
Start Free Assessment