[ PRODUCTION]
Built at Quantum Strides · sole AI engineer

NL-to-SQL Facility Intelligence Platform

A governed natural-language interface that turns plain-English questions into safe, accurate SQL across a 300-table facilities warehouse.

Role
Sole AI Engineer
Year
2025
Stack
9 technologies
Status
Production
// overview
A natural-language analytics layer over a sprawling facilities database — staff ask questions in plain English and get governed SQL answers in seconds. I built it solo end-to-end on AWS, from schema-aware retrieval through to a semantic cache that cut inference cost by roughly 60%.
// the problem
Operations teams needed answers from a Postgres warehouse of 300+ tables across 20+ schemas, but couldn't write SQL — analysts were the bottleneck. Off-the-shelf text-to-SQL hallucinated joins and leaked across schemas. The system had to be accurate, safe, and cheap enough to run at scale.
// architecture
01 · input
NL query
plain english
02 · retrieve
Schema retrieval
from S3
03 · assemble
Few-shot prompt
dynamic examples
04 · generate
Claude
via Bedrock
05 · execute
Postgres
read-only run
// side rail
Semantic cache
Redis · embeddings
⟲ near-duplicate query → return cached SQL, skip the LLM
// what i built
  • Schema-aware retrieval — indexed 300+ tables across 20+ Postgres schemas in S3, surfacing only the relevant tables for each question.
  • Few-shot prompt assembly with dynamic example selection and guardrails that block unsafe or cross-schema SQL.
  • Claude on Amazon Bedrock for NL→SQL generation, with a validation and auto-repair loop on execution errors.
  • Semantic cache in Redis keyed on query embeddings — near-duplicate questions return instantly and skip the LLM.
  • Read-only execution layer over Postgres with row limits, query timeouts, and full audit logging.
  • Result formatting into tables, charts, and plain-language summaries for non-technical operations staff.
// impact
~0%
inference cost cut
0+
tables covered
0+
schemas unified
// tech stack
PythonAmazon BedrockClaudePostgreSQLRedisAmazon S3AWS LambdaWebSocketPydantic
next project
Agentic Walkthrough Assistant for Enterprise IWMS