CASE 02AI Engineering · Cloud Architecture · AWS

DataPulse — Governed Text-to-SQL Intelligence Layer

Accuracy and enterprise trust in Text-to-SQL are not solved by a larger model. DataPulse removes the LLM from SQL construction, security, and validation — utilizing the model strictly for natural language understanding while delegating execution to a deterministic compiler, AST policy governor, and cryptographic audit log.

RoleLead Full-Stack Architect & Cloud Systems Engineer
Timeline / Year2026
Domain / FocusDataPulse / Enterprise Intelligence
Core TechnologiesAWS Bedrock · FastAPI · Python
Project Contributors & Engineering Leadership
Aleksandar KuzmanovicLead Full-Stack Architect & Cloud Systems Lead · Performance, Development, Web Design & SEO/GEO Specialist
Luka StefanovicPrincipal AI & Data Science Lead · Applied Mathematics, AI & Data Science Lead
datapulse---governed-text-to-sql-intelligence-layer.sys
CASE 02
DATAPULSE // GOVERNED SMQ ARCHITECTUREAWS BEDROCK + DYNAMODB + S3
Natural Language Question

"Show quarterly enterprise revenue and churn rate broken down by customer tier with active contracts."

DETERMINISTIC SMQ COMPILER ──▶ SQL AST✓ Row-Level Security (RLS) Enforced
SELECT tier, SUM(mrr) AS rev, AVG(churn_risk) AS risk
FROM cube.customer_metrics
WHERE tenant_id = 'tenant_091a' /* AST-Injected RLS */
GROUP BY tier ORDER BY rev DESC;
Output: Table + Vega-Lite Chart + NarrativeHash-Chained Audit Log VerifiedP95: 742ms
01 / The Architectural Challenge

Overcoming production bottlenecks and scalability constraints.

Enterprise relational schemas contain hundreds of tables with complex foreign keys and tenant isolation requirements. Relying on raw LLM prompts to write SQL leads to hallucinations, SQL injection vulnerabilities, unauthorized cross-tenant data leaks, and unpredictable latency (>4s) unacceptable for decision-makers.

02 / The Engineering Solution

Engineered with disciplined primitives and modern runtimes.

Engineered an end-to-end governed pipeline: User question ──▶ DSA vector schema retrieval & pruning ──▶ LLM generates a structured Semantic Model Query (SMQ) ──▶ Deterministic SMQ compiler compiles to SQL ──▶ RLS policy engine injects row-level security at the SQL AST level ──▶ SQL Governor validates against allowlists ──▶ Execution on Postgres / Cube semantic layer ──▶ Return table, interactive Vega-Lite chart, and natural-language narrative with tamper-evident audit logging.

03 / Technical Architecture

Decisions made for durability, zero lock-in, and throughput.

FEATURE // 01

Deterministic SMQ Compiler & AST Policy Engine

The LLM is never trusted with raw SQL or security. It produces structured SMQ intent; a deterministic compiler generates SQL from governed metric/dimension definitions, while an AST visitor enforces row-level security (RLS) directly in the parse tree.

FEATURE // 02

AWS Cloud Architecture & LocalStack

Integrated with AWS Bedrock for foundation model inference, Amazon DynamoDB for persistent semantic models, and Amazon S3 for automated semantic snapshots & restores, with full LocalStack & Docker Compose local dev parity.

FEATURE // 03

DSA Optimization & Hash-Chained Audit Log

Optimized with vector schema pruning to reduce prompt overhead by 85%, tree traversal algorithms for AST injection guardrails, and cryptographic hash chaining (SHA-256) recording question, compiled SQL, row count, latency, and token cost with tamper-evident verification.

FEATURE // 04

Complete Generative Engine Optimization (GEO) & Semantic Knowledge Layer

Transforms tabular SQL query outputs into rich Schema.org semantic entities, high-authority synthetic summaries, and citation-grounded natural-language answers—engineered specifically for complete Generative Engine Optimization (GEO) across Google AI Overviews, Perplexity, and ChatGPT Search.

04 // Quantifiable Impact

Measured by results.

Achieved 99.4% execution accuracy on enterprise benchmarks, sub-800ms median P95 response times, zero SQL injection vectors, and verified cryptographic audit integrity.

<800ms
Query Latency
99.4%
Accuracy
AST Guard
Security