05 / Applied AI & Analytics
In progressSelf-Healing BI & SQL Analytics Agent
Target role · GenAI / Agentic AI Engineer
A read-only analytics agent that inspects schemas, generates and validates SQL, self-corrects failures, and creates reviewed insights.

- Target: self-correction within three retries
- Safety: read-only execution · human review
Problem & direction
Core problem: Standard text-to-SQL prompts fail on complex joins and can send invalid or unsafe queries into reports.
An in-progress analytics agent helping non-technical users ask data questions while keeping execution read-only, inspectable, and recoverable when generated SQL fails.
How it works
- 01
Inspect the PostgreSQL schema and business definitions
- 02
Generate and validate SQL against a read-only replica
- 03
Feed errors back through a self-correction loop for up to three retries
- 04
Create Plotly charts and insights with human review for ambiguity
Engineering details
Schema-aware generation
A Schema Inspector grounds SQL generation in available tables, fields, relationships, and business context.
Bounded self-correction
Database errors return to the SQL Generator for a maximum of three correction attempts rather than looping indefinitely.
Safe execution
Queries run against a read-only replica. Ambiguous or high-impact actions are routed to a human review step.
Charts and explanations
Pandas and Plotly turn valid results into interactive charts and concise narrative insights.