I designed this as a self-learning data agent. A person asks a business question. The agent assembles six layers of context, writes SQL for the warehouse it is connected to, runs it, reasons over the result and returns an insight with a chart. When a query fails because the schema is not what the prompt assumed, it inspects the live catalogue, corrects itself and remembers the fix.
The six layers are what make it more than a text-to-SQL demo: a semantic model of tables and relationships; explicit business rules and metric definitions; a memory of validated question-to-SQL patterns; institutional knowledge from uploaded documents; a temporal knowledge graph of successes, failures and corrections; and runtime introspection of the live warehouse. Two learning systems run in the background — one stores good examples, the other records how the work evolved.
The product includes chat, a knowledge workspace, a graph explorer and an admin surface for training and evaluations, with enterprise sign-in, tenant isolation, audit logging and a locked-down sandbox for heavier analysis.
Key capabilities
- 01Natural-language analytics over an enterprise warehouse, streaming the answer, the SQL and the chart
- 02Six context layers, combined on every question
- 03Self-correction via live schema introspection, then memory of the correction
- 04Dual learning: example RAG plus a temporal knowledge graph
- 05Document upload and hybrid search for institutional knowledge
- 06Multi-tenant sessions, audit trail, rate limiting and SSO
- 07Isolated code sandbox for deeper analysis, with no credentials and tight resource limits
- 08Evaluation harness for grading answers
Stack
Python FastAPI backend. Next.js frontend with AI SDK streaming, shadcn/ui and Plotly/Recharts. Vanna AI for text-to-SQL. Azure OpenAI for the model and embeddings. PostgreSQL with pgvector. Graphiti on FalkorDB for temporal memory. SQL runners for Microsoft Fabric (T-SQL) and PostgreSQL. Microsoft Entra ID for SSO. Sandboxed analysis runtimes. Docker Compose locally; Railway in production.